WAV 8-bits mono #769
-
|
Hi @pschatzmann . I'm trying to use NumberFormatConverterStreamT<int16_t, uint8_t> nfc(kitStream), to transform line-in signal to 8-bits. Later I'd like to copy this signal to wav file but nothing is recorded. If I remove nfc all is ok but 16-bits. How Can I record on WAV 8-bits MONO signal from Line-in? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
I don't see any reason why this should not work! You could try to replace the output with a CsVOutput or a HexDumpOutput to see if you get any data... |
Beta Was this translation helpful? Give feedback.
-
|
Hi @pschatzmann . I try all possible but the result always is the same, WAV is empty. This is my sketch. What is wrong? kitStream is configured for AudioBoard audiokit v2.2 ESP32 A1S and works fine with WAV, MP3 playing and WAV 16 bits recording, but not 8-bit recording. kitStrem uses Line-in for recording and Line-out for sound monitoring. |
Beta Was this translation helpful? Give feedback.
-
|
I was testing with the following sketch and was getting the correct result. AudioInfo info(8000, 1, 16);
SineWaveGenerator<int16_t> sineWave( 32000);
GeneratedSoundStream<int16_t> sound( sineWave);
//CSVOutput<uint8_t> out;
HexDumpOutput out(Serial);
WAVEncoder wav;
EncodedAudioStream encoder(&out, &wav);
NumberFormatConverterStreamT<int16_t, uint8_t> converter(encoder);
StreamCopy copier(converter, sound);
void setup() {
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
delay(5000);
// Setup sine wave
auto cfgs = sineWave.defaultConfig();
cfgs.copyFrom(info);
sineWave.begin(info, N_B4);
converter.begin(info);
encoder.begin(converter.audioInfoOut());
out.begin();
Serial.println("Test started...");
}
void loop() {
copier.copy();
}Log I committed the following changes:
I was double checking the hex dump with Chatgpt fmt Subchunk ✅ NOW CORRECT FOR 8-BIT! |
Beta Was this translation helpful? Give feedback.
I don't see any reason why this should not work!
Did you eventually forgot to call begin on the converter ?
You could try to replace the output with a CsVOutput or a HexDumpOutput to see if you get any data...