Using the example from WWDC, with the following command
./SignalGenerator -signal square -duration 3 -output ./uncompressed.wav
I can generate an audio file, which is not playable, and its Get Info is:
- Duration: 00:00
- Audio channels: Mono
- Sample rate: 44,1 kHz
- Bits per sample: 32
Although for MacOS Preview the duration is zero, this file is playable in VLC and convertible to other formats, so its content is ok. To get more information about the format of an output file I changed the example to print outputFormatSettings:
["AVLinearPCMBitDepthKey": 32, "AVLinearPCMIsBigEndianKey": 0, "AVSampleRateKey": 44100, "AVFormatIDKey": 1819304813, "AVLinearPCMIsFloatKey": 1, "AVNumberOfChannelsKey": 1, "AVLinearPCMIsNonInterleaved": 1]
I don’t know how to interpret the “number of AVFormatIDKey": 1819304813. The documentation says:
let AVFormatIDKey: String - For information about the possible values for this key, see Audio Format Identifiers
Having red this, I still don't know the relation of AVFormatIDKey and listed Audio Format Identifiers.
If I knew which file format to expect, it might have helped to guess why the duration of the generated files is always 0? Can you help me with both questions? Thanks.