I have a *.wav file. How do I change the bit rate(bits per sample) of it?
67 views (last 30 days)
Show older comments
Akhil Jain Choadhry
on 13 Sep 2019
Commented: Talal Salim
on 1 Jun 2020
I know the sampling frequency, bits per sample(bps) of the audio file. How can I change the bit rate?
0 Comments
Accepted Answer
Star Strider
on 13 Sep 2019
The only way I am aware of to change the bit rate is to read the audio file using audioread, then write it with audiowrite using different values for 'BitsPerSample' and 'BitRate'. See the documentation on the relevant functions, and Read and Write Audio Files for details. If you also want to change the sampling frequency, use the resample function before writing the file.
1 Comment
Talal Salim
on 1 Jun 2020
is there a way to change the 'BitsPerSample' without using audioread, because I have a lot of wav files that characterized by 4 bits as their bit depth, and unfortunately these wav files cant be read using the audioread function, it gives this error:
[File could not be read due to an unexpected error. Reason: Error in WAV/W64/RF64/ file. Malformed 'fmt' chunck]
More Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!