필터 지우기
필터 지우기

how to use dsp.AudioFileWriter to write 24b bit depth audio?

조회 수: 7 (최근 30일)
Sven Larsen
Sven Larsen 2023년 10월 12일
댓글: Mathieu NOE 2023년 10월 13일
Normally, I use
audiowrite(fileName,y,Fs,'BitsPerSample',BitsPerSample);
however, for large files, stream audio write is needed and afaik dsp.AudioFileWriter is the only way to write/append audio in chunks to file. 24 bit depth is crucial for me when writing audio, how that can be achieved with dsp.AudioFileWriter?

채택된 답변

Mathieu NOE
Mathieu NOE 2023년 10월 12일
Hi
change DataType properties from int16 (default) to int24
Properties
Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.
If a property is tunable, you can change its value at any time.
For more information on changing property values, see System Design in MATLAB Using System Objects.
Filename Name of audio file to which to write
'output.wav' (default) | character vector | string scalar
FileFormat Audio file format
'WAV' (default) | 'AVI' | 'FLAC' | 'OGG' | 'MPEG4' | 'OPUS' | 'WMA' | 'MP3'
SampleRate Sampling rate of audio data stream
44100 (default) | positive scalar
Compressor Algorithm that compresses audio data
'None (uncompressed)' (default) | 'CCITT A-Law' | 'CCITT u-Law' | 'GSM 6.10' | 'IMA ADPCM' | 'Microsoft ADPCM' | 'PCM'
DataType Data type of the uncompressed audio
'int16' (default) | 'double' | 'single' | 'inherit' | 'int24' | 'int32' | 'uint8'
  댓글 수: 2
Sven Larsen
Sven Larsen 2023년 10월 13일
Oh my, how could I not see that DataType basically is same thing as audio bit depth. Thank you so much, got it to work!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by