Playing an MP3 with LAME - c#

I'm looking into making a desktop music player, probably in C# (not certain yet), and for MP3 support I would like to use LAME for various quality and other reasons. I am used to coding in Java and as such have only used Java libraries with Java and don't quite understand how to use LAME to play an MP3 in my program.
I have used lame.exe on the command line to decode an MP3 to WAV (lame.exe --decode "filename.mp3") but don't see how I can play an MP3 with LAME nor how to do it in a program (i.e. not using command line).
Do I have to be using C to use the LAME library?
Also do I have to decode the MP3 first before playing?

Related

How to decompress MP3 to WAV in Windows Store app?

I want to find pitches in raw of wav file using FFT and etc. but before I should to decompress MP3 file.
I am using C# with WinRT, and I'm very limited for third-party libraries which often cause exceptions.
You might try NLayer. It's purely managed code (with no P/Invoke), so it should run just fine in a WinRT app.
Disclaimer: I am a major contributor to NLayer.

How to rip WAV audio stream from MP4 stream in C#

Is there any way to rip the audio out of an MP4 stream (or file) in the form of WAV without the use of 3rd party software (only using Windows API) in C# code?
I have looked around and the majority of answers revolve around FFMPEG however I must avoid 3rd party software. I tried dabbling in the DirectShow API but I am not sure that will get the audio stream rip I am looking for (if anyone has successfully done it in DirectShow could you provide steps). I would prefer the output to have the WAV headers and such. Maybe rip to MP3 format and convert to WAV?
Thank you for your help and suggestions

Extracting and splitting a MP3 audio stream from an AVI file

I want to develop a desktop application by programming in C# and using the .Net framework 4.
The goal of my application is to extract a MP3 audio stream from a supplied AVI file.
I have learned from the Internet that an AVI file is a container and it might contain different audio streams.
If the supplied AVI file contains one MP3 audio stream at least then I want to extract it and split it.
I want to split the MP3 audio stream into MP3 audio parts identified with a start time and an end time.
I have looked on the Internet for any .Net library I could use but without success.
Does someone know what documented .Net library would be useful ?
Maybe you can try this:
Simple C# Wrapper for the AviFile Library
It is targeted at AVI video but there might be some clues as how to use the same methods to extract the audio only.
Either use it as-is or use the example to incorporate what you need into your own code.
Since tools for this task already exist, I see no point in creating another one unless you're curious about how to do this yourself and learn something new.
If so, using a ready-made library would defeat the entire idea of learning something which is why I strongly recommend you try implementing the splitter yourself.
You can find descriptions of the AVI file format online, that should get you started.

Output procedurally generated (or externally streamed) audio on Windows Phone 7

I'm looking at developing an application for the WP7 platform which accepts an audio stream from a computer and outputs that stream on the phone speaker. This involves either dealing with the audio encoding / decoding myself, or somehow passing off an audio stream to the WP7 platform.
I've struggled so far to find any raw audio output API's and I am not sure what I have to do on the server (computer) side to get the phone to just deal with the audio stream.
I have looked at a few MSDN articles, but I can't quite tell if they do what I want. If somebody could point me in the right direction that would be great!
I think the MediaStreamSource class does what I'm looking for, and the MediaStreamSource.ReportGetSampleCompleted method appears to confirm this, but nowhere does it say clearly that it can be used for raw audio.
If you need any information, or if you have any suggestions of better ways to do this that would also be appreciated!
You should be able to use the XNA.Framework.Audio namespace SoundEffect to get a soundeffect instance from a raw audio stream. Which should usually be a standard PCM format.
This post on microphone by Charles Petzold could be useful.
An excerpt
In contrast, classes in the Microsoft.Xna.Framework.Audio namespace
work with uncompressed audio data in the standard PCM format, which is
the same method used for audio CDs and Windows WAV files.

How to convert AMR sound stream to PCM uncompressed stream in .NET

I need to convert an AMR (Adaptive Multi-Rate) audio file recorded in a phone (as a Stream object) to a PCM uncompressed wav audio Stream so it can be processed afterwards for speech recognition. The Speech Recognition doesn't like the AMR format. This is going to be a server application using the Microsoft Speech Platform. I am not sure about using the ffdshow or similar libraries in a .
Right now I am researching NAudio and DirectShowNet to see if they can help me accomplish this but was hoping someone can point in the right direction.
After a lot of searching for a solution for this, I am going to use ffmpeg. It provides the AMR-NB (NB=Narrow Band) decoder. There are a lot of c# wrappers for ffmpeg around; most of them abandoned efforts and one that is up to date but is not free. Just running ffmpeg with the basic parameters provides what I need, plus it is really fast.
I don't like the idea of calling an external process to do the conversion, plus I need to save the AMR stream as a file so it can be converted to a wav file but I believe I can make it work efficiently.

Categories

Resources