我如何使用C#读取file.wav [英] how can I read file.wav using C#
本文介绍了我如何使用C#读取file.wav的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用C#中的路径读取存储在数据库中的file.wav和file.mp3.
how can I read file.wav and file.mp3 stored in a data base using their path in C#
推荐答案
尝试 ^ ] ?关于这个话题也有类似的问题.另外,我敢打赌Google上也有很多东西.对于检索部分,您需要熟悉ADO.Net才能从数据库检索路径.
Tried looking here[^]? There have been similar questions regarding the topic. Also, I bet there are a lot of stuff on Google too. For the retrieving part, you need to be familiar on ADO.Net to be able to retrieve the path from the database.
您不使用路径从数据库检索数据,则应使用查询(通常为SQL
查询).
我相信像.wav
和.mp3
这样的二进制文件在数据库中存储为BLOB
.开始开发之前,您应该阅读数据库教程.
You don''t use a path for retrieving data from a database, you should use a query (usually aSQL
query).
I believe binary files like.wav
and.mp3
are stored asBLOB
s inside the database. You should read a database tutorial before starting developing.
您好,
这是您的代码:
Hi,
this is your code:
[DllImport("kernel32.dll")]
System.Media.SoundPlayer player = new SoundPlayer();
player.SoundLocation = "Your sound Location.wav";
player.LoadAsync();
player.PlayLooping(); //asynchronous (loop)playing in new thread
Thread.Sleep(1000);
player.Stop();
这篇关于我如何使用C#读取file.wav的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文