I need a software that can stream audio with mp3 format.The audio will come from the microphone at the same time.
I have a software that can stream sound with alaw and ulaw codecs.
And I have an another program that can stream recorded mp3 file. Not capture from the microphone.
I can make stream with VLC.Dotnet wrapper but I didn't succeed with directshow.(namely microphone)
Here my Vlc.Dotnet code;
myVlcControl.Play("dshow://");
myVlcControl.Play(new Uri("dshow://"));
It did not work with this codes. I don't know what causes the problem.
My second software can stream sound that captures form microphone in real time. But its codec format is alaw not mp3. I did not find any converter that convert linear to mp3 file. I find a converter that convert linear to alaw. this is the link Linear to Alaw Codec
I know the LAME and NAudio but it converts wav file to mp3. I need linear to mp3(like in the link)
I am very confused. I really do not know which way to go.
1. Find a codec linear to mp3 (It's very complicated) ?
2. Learn VLC direct Show usage on .NET ?
Thank you so much in advance.
*VLC.DotNet, axVLCPlugin21, LAME, ffmpeg....
As soon as I've successfully solved this problem with VLC.Dotnet wrapper. The problem is compiling with x64 architectural. When I was compiled with x86 architectural, The problem solved.
Related
I am developing a C# application that records streaming audio to MP3.
I’m new to this but from what I’ve seen so far, the easiest way to do this is record to WAV using NAudio and then create an MP3 version using either LameMP3FileWriter or MediaFoundationEncoder.
I’m running into problems with the conversion, however, as my PC sound system is 5.1 and the MP3 conversion crashes due to the number of channels in the recorded WAV file. It works fine when I reconfigure my sound system to stereo but this is a bit of a pain; firstly, it means I cannot use my 5.1 system when recording the music but more of an issue, for some reason that I cannot figure out, if I set my speakers to stereo, they revert to quadraphonic when the PC (Windows 10) is rebooted!
Can anyone suggest how I can do this conversion without the need to configure my 5.1 sound?
One obvious solution to do something like resampling the WAV file to 2 channels before the conversion to MP3 but that seems something of a ‘long shortcut’. I’m also unclear as to the advantage of recording to WAV in the first place – audio streams are compressed and unlikely to have more than 2 channels to start with so playing it over 5.1, no matter how good it sounds, is really a bit illusory.
It would seem more sensible to just record the stream direct to MP3 but I cannot find any straightforward way of doing that.
Mp3 specification does not handle 5.1. So it seems your mp3 encoders fail with 5.1.
Perhaps you can try an encoder that support MP3 Surround, an mp3 extension for 5.1.
Also, Perhaps you should consider using AAC encondig, a more friendly codec for 5.1.
I'm a reasonably advanced C++ programmer, as a bit of background. At this point, I'm wanting to experiment a bit with sound. Rather than use a library to load and play files, I'm wanting to figure out how to actually do that myself, for the understanding. For this application, I would like to read in a .wav file (I already have that part down), then output that data to the speakers. How do I push a waveform or the data from the file to the speakers on my computer? I'm on Windows, by the way.
You can read this article about how to set up the audio device and how to stream data into the device for playback on Windows. If using this library is too high-level for you and you'd like to go deeper and write your own decoding of WAV files and outputting that to a sound card, you have far more research to do than what's appropriate for an answer here.
How can I convert WAV in MP3 using QtMultimedia?
There is some specific class for reading WAV and writing MP3 files?
As far as I know there is no MP3 encoder packaged with Qt. You'll have to use an external library.
Edit: this is confirmed by this thread at least as far as Qt4 is concerned (no idea about Qt5 though but I suspect it's the same).
I learned how to encode wav into an mp3 using lame_encode_buffer_interleaved from this question: Is there any LAME c++ wraper\simplifier (working on Linux Mac and Win from pure code)?
Now I want to decode the mp3 back into wav. I know there's lame_decode but I don't know how to use it since it requires two pcm buffers (pcm_l and pcm_r). I don't understand how to put them together into a well-formed wav file, because I don't really know how they works.
Now can someone provide a simple working example on decoding an mp3 into a wav using lame in C/C++?
Thanks.
Take a look into the lame frontend source code. Start at the lame_decoder() function in the .../frontend/lame_main.c file, it decodes an MP3 file and writes the wave header.
I'm looking for a way to extract the audio part of a FLV file.
I'm recording from the user's microphone and the audio is encoded using the Nellymoser Asao Codec. This is the default codec and there's no way to change this.
ffMpeg is the way to go !
It worked for me with SVN Rev 14277.
The command I used is : ffmpeg -i source.flv -nv -f mp3 destination.mp3
GOTCHA :
If you get this error message : Unsupported audio codec (n),
check the FLV Spec in the Audio Tags section.
ffMpeg can decode n=6 (Nellymoser).
But for n=4 (Nellymoser 8-kHz mono) and n=5 (Nellymoser 16-kHz mono) it doesn't work.
To fix this use the default microphone rate when recording your streams, overwise ffMpeg is unable to decode them.
Hope this helps !
This isn't an exact answer, but some relevant notes I've made from investigating FLV files for a business requirement.
Most FLV audio is encoded in the MP3 format, meaning you can extract it directly from the FLV container. If the FLV was created from someone recording from their microphone, the audio is encoded with the Nellymoser Asao codec, which is proprietary (IIRC).
I'd check out libavcodec, which handles FLV/MP3/Nellymoser natively, and should let you get to the audio.
I'm currently using FFmpeg version SVN-r12665 for this, with no problems (the console version, without any wrapper library). There are some caveats to using console applications from non-console .NET environments, but it's all fairly straightforward. Using the libavcodec DLL directly is much more cumbersome.
I was going to recommend this: http://code.google.com/hosting/takenDown?project=nelly2pcm¬ice=7281.
But its been taken down. Glad I got a copy first :-)