16-24 Bit resample and Volume impact ? and VolumeMeter output ? #704
-
Hi Phil, all |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Setting the volume for A2DP is always done with 16 bit calculations. If you report using the VolumeMeter using volumePercent(), volumeRatio() or volumeDB() there should not be any difference but the reported volume() values depend on the bits: the max values for
Make sure that the VolumeMeter is configured correctly with the correct input bits per sample. Maybe you did something wrong in your sketch ? |
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
That might be it, I configured the VolumeMeter with the output resample configuration 24 Bit not the native A2DP felt more correct so A2DP and the I2S output where the same.
Code snippet:
// Define streams
AudioInfo input_stream_info(44100, 2, 16);
AudioInfo output_stream_info(48000, 2, 24);
// Define Outputs
I2SStream I2Sout;
VolumeMeter vuMeter;
MultiOutput multiOut;
ResampleStream resample_stream(multiOut);
BluetoothA2DPSink a2dp_sink(resample_stream);
// Add Outputs
multiOut.add(vuMeter);
multiOut.add(I2Sout);
// Setup the resample stream from 44100 Hz (from_info) to 48000 Hz 24 bit
resample_stream.begin(input_stream_info, output_stream_info.sample_rate);
// Setup I2S Output
auto cfg = I2Sout.defaultConfig();
cfg.copyFrom(output_stream_info);
cfg.pin_bck = 22;
cfg.pin_ws = 25;
cfg.pin_data = 21;
I2Sout.begin(cfg);
vuMeter.begin(output_stream_info);
Brgds,
Ives Heymans
From: Phil Schatzmann ***@***.***>
Sent: Wednesday, 30 April, 2025 8:38 AM
To: pschatzmann/ESP32-A2DP ***@***.***>
Cc: Ives-Heymans ***@***.***>; Author ***@***.***>
Subject: Re: [pschatzmann/ESP32-A2DP] 16-24 Bit resample and Volume impact ? and VolumeMeter output ? (Discussion #704)
Setting the volume for A2DP is always done with 16 bit calculations.
If you report using the VolumeMeter using volumePercent(), volumeRatio() or volumeDB() there should not be any difference but the reported volume() values depend on the bits: the max values for
* 16 bits: 32767
* 24 bits: 8388607
* 32 bits: 2147483647
Make sure that the VolumeMeter is configured correctly with the correct input bits per sample.
Maybe you did something wrong in your sketch ?
-
Reply to this email directly, view it on GitHub<#704 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2TVDDG3AX27M4XE3LU7RND24BVWDAVCNFSM6AAAAAB4EV4INWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJYHA4TOMI>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
Setting the volume for A2DP is always done with 16 bit calculations.
If you report using the VolumeMeter using volumePercent(), volumeRatio() or volumeDB() there should not be any difference but the reported volume() values depend on the bits: the max values for
Make sure that the VolumeMeter is configured correctly with the correct input bits per sample.
Maybe you did something wrong in your sketch ?