i know there are many topics like mine, but i would realy love if somebody could explain me the theory behind the code.... what is the format of data you get from microphone?? Do same sounds return the same data from microphone or do you realy have to go through fft process if you want to compare sound samples.... Where can you save microphone data and analize it in live stream?
have a look at the open source .NET Voice Recorder project which uses NAudio. There is an article on Coding4Fun explaining how it works.
Related
I am looking to make a sound visualizer with Unity3D (mainly for the UI and graphics), and as I get ready to export the project, I need to know how to get a live audio feed from whatever is playing on the computer and translate that to the audio samples that my program uses.
Currently, I use preset .mp3 files and apply them to audiosources, and a script updates the samples live and those translate to the bars you see in audio visualizers. I would like to move this up a step, but I don't know how to do that. I've looked into NAudio and CSCore, but I haven't been able to make anything work.
All I need is for NAudio or CSCore to record to a file, and also have me continuously play that file. That seems like it would have problems though, so if I can just get a sound card stream and use that data to pass through to the program, that would be great.
If anyone has any experience, docs, or tips that can help me out, please send them over. Appreciate the help, thank you.
I'm two days into researching this so I thought I'd post here. It looks like video recording software is usually written in C++ but my project requires C#. It's a WPF application and I just need it to save an mp4 locally. I don't need to upload to a server, I don't need to let the user pick a file location, I don't even need it to display the webcam feed as it's recording. All I need it to do is start/stop recording audio and video from a webcam/microphone and save it in a location that's determined by the code. I understand this may be broken down into steps like connecting to a webcam, connecting to a microphone, synchronizing them, encoding a video file, and saving it on the hard drive.
Are there any .NET classes that can help me with this? If not, can anyone recommend some libraries/frameworks/etc. that handle this sort of thing? I appreciate any help regarding how to do this. Thank you.
a bit of background:
this summer, i set myself a programming project,
where i want to make an E-jay clone(a program with simple drag-drop blocks which are little bits of music and beat to make a track)
now i dont really know where to start on the whole encoding music bit.
for example:
how does a sound file work?
how do i transform a piece of a sound file into a universal piece of sound information
how do i create a sound file from scratch
how do i add pieces of sound to a previously newly created sound file
im sorry if i seem like one of those guys that cant use google n stuff. but i have no experience with sound or anything on that part.
programming language: C#
ultimate goal: be able to encode a new mp3 file using small sound files which are inserted on certain points in the file to ultimatly make music
any help is appreciated,
thank you for reading my question.
I think you should check NAudio site - it has lots of examples.
Do some research into the MPEG compression standard, as you'll need to know about decoding as well as encoding. If you are going to be ambitious, maybe look into other audio file types as well.
MP3 Links:
MP3 Format
ISO Draft on the MPEG standard
My question is simple,
I would like to do this :
http://www.codeproject.com/Articles/19854/Sending-and-playing-microphone-audio-over-network
But with another codec , in MP3.
Its possible with a free SDK/tools ... ?
Thanks
I would probably use the NAudio library and send the buffer with sockets (which should be easy since they're both a byte array).
I can't expend too much because NAudio and sockets are 2 complete subjects.
But I can provide links:
NAudio
Any information you'd probably need + download can be found here
The videos in this user is a nice series that explains NAudio
Sockets - pretty hard subject for me so I'll give more links
http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.aspxhttp://www.codeguru.com/csharp/csharp/cs_misc/sampleprograms/article.php/c7695/Asynchronous-Socket-Programming-in-C-Part-I.htm
http://www.csharp-examples.net/socket-send-receive/
http://www.codeproject.com/Articles/5252/Sockets-in-C
http://www.developerfusion.com/article/3918/socket-programming-in-c-part-1/
http://www.codeguru.com/csharp/csharp/cs_misc/sampleprograms/article.php/c7695/Asynchronous-Socket-Programming-in-C-Part-I.htm
http://csharp.net-informations.com/communications/csharp-socket-programming.htm
Don't forget to use Google!
Once you have basic understanding read my first sentence (with the buffer) and it will be clear.
P.S. NAudio might need another .dll to handle mp3, not sure, but it shouldn't be hard to find.
VLC Media Player can stream in a variety of different formats, including Icecast. I have not used them myself, but it looks like a nice starting point.
I am looking to create an application that will allow me to record from my mic and playback the recording through other pc's. At this point however I would just like it to play back on my own computer so I can get it working.
I have been looking at NAudio for the past few hours and it seems like it may be able to help me achieve this goal.
I am just wondering if anyone else has had any experience with this and if it is at all possible?
Thanks,
Stuart
There is an example project on codeproject doing this:
http://www.codeproject.com/KB/cs/Streaming_wave_audio.aspx
I don't know how low the latency is.
As a codec I'd recommend Speex(at least for speech). It's free, open source and offers low latency and low bandwidth.
Bass Audio Library is another solid option worth looking into.
It is possible to do, but you are unlikely to get low latency with WaveIn/WaveOut (possibly better results with WASAPI). You could use the BufferedWaveProvider (in the latest source code) to store up the audio being recorded from the microphone and supplying the output to soundcard.
NAudio is great as a starting point for audio capture and playback but as Mark pointed out the latency might be an issue.
If you take the next step and want to sent the audio data across the network you will need a codec to compress the data as PCM or WAV are uncompressed and for voice you only need a small part of the bandwidth needed for WAV.
As you are working with C# there is a C# port of Speex available, called NSpeex, which might be worth having a look at..