Rendering a wav file from wav files in c# - c#

I got some short .wav files and after i get sequence how it should be played in time I need to "render" a one wav file which will contain that .wav files. I know I can append it but the problem is that some wav files should be played at one time, and also it need to be in rhythm (exact spaces).
How?

You will need to use some libraries like ffmpeg or SoX to do this.
Reference: http://ffmpeg.org, http://sox.sourceforge.net

Related

What is the output format of microphone to save it in Wav

I'm recording audio from the microphone in unity and saving it as an AudioClip. The thing is I need to know in which format (either ogg or uncompressed) it is saved so I can convert it to Wav. I would also need help to convert it to wav.
You may try both cases with SoX library but it's hard to put it inside unity project
If your going to after saving your audio just convert to wav it won't matter much which one you pick. You could in theory lose some quality with the compressed version. You will want to use a program like Audacity to convert it to wav.

Listen to wav file C#

What I am wanting to do is have my program listen to a wav file that consists of highs and low and be able to determine what one is what
(basically converting the highs and lows in the wav files to 1's and 0's)
After some googling I haven't found anything that would be able to listen to an audio source or wav file directly to do this so I am currently stumped on what to do next...
I recommand you to take a look at the NAudio library which allow you to read a WAV file very easily.
Then you will probably need to detect the "highs and lows" yourself by analysing the databytes extracted from your WAV file and create the output file you are looking for also with NAudio (this is basically analysing and filling byte arrays).
This is a usefull article that can help you to understand how to do this :
Audio Formats - Mark Heath
And some other threads directly on stack : How to read the data in a wav file to an array

Split the audio file by words

There is audio file. Where few "words" with different time between them. I need to make as many .wav files as "words" in the file. Audio file is very clear, there is no noise, so it must be very easy to find the "words". Any ideas how to make it with C#? Maybe somebody knows any libraries?
Please check an example of waveform of the file:
NAudio is good. You'll be able to read the WAV header so you know what format was used to store the file. Then you can just scan it and grab the regions where the entropy is higher.
https://naudio.codeplex.com/releases/view/612263

Combining two audio files in C#

There are 2 audio ( mp3 or wav) files. The first file has the voice of me, the second one has the voice of my friend. Each of them has 10 seconds duration.
I want to combine them to get one file that also should have 10 seconds duration.
What are the tools or utilities I should use to solve this issue?
UPDATE: I used lame.exe, but it concatenated them and created the file of 20 seconds duration.
This might do the trick.
My WAVFile class supports 8- and 16-bit audio, mono or stereo. One of
its special features is a method that will mix WAV audio files
together, so that the audio from each source WAV file will be heard
simultaneously.
Note: In the above paragraph, My refers to the author of the class, not to myself.
Check out NAudio tutorial: Mixing multiple wave files together in real time.

How can I split an mp3 file into several individually playable parts?

How can I break a large mp3 file into one or more mp3 files, and still have each part playable in a media player?
It's probably not going to be super easy to break an mp3 file into separate playable mp3 files. There is header information in the mp3 file that you will need to include in all of the split-up files. You might need to get a book or look for a file spec on mp3s, so you know what you're dealing with.
You might be best-off looking for a library that can deal with mp3 files, rather than trying to do it yourself with a FileStream.
Actually, breaking a MP3 file into seperate playable MP3 files is quite easy. A MP3 file consists of a lot of individual frames of iirc 1500bytes, where each has it's own header. Invalid data will be ignored by the player.
But, it would be a lot better if you where to split your files on frame boundaries, creating correct mp3 files. More info on the frame header can be found on this site: http://www.mp3-tech.org/programmer/frame_header.html
Please also consider the possibility that the music is prepended and/or appended with various meta tags, like ID3, APE and lyrics.

Categories