Skip to content

Commit

Permalink
💡 [Audio] Rename TODO(Audio-Philippe) as TODO(Audio)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Dec 9, 2023
1 parent e4e8303 commit 445262f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/InputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void InputStream::set_device(RtAudio::DeviceInfo const& info)
params.deviceId = info.ID;
params.nChannels = 1;
unsigned int nb_frames{512}; // 512 is a decent value that seems to work well.
auto const sample_rate = info.preferredSampleRate; // TODO(Audio-Philippe) Should we use preferredSampleRate or currentSampleRate?
auto const sample_rate = info.preferredSampleRate; // TODO(Audio) Should we use preferredSampleRate or currentSampleRate?
_backend.openStream(nullptr, &params, RTAUDIO_FLOAT32, sample_rate, &nb_frames, &audio_input_callback, this);
_backend.startStream();

Expand Down
2 changes: 1 addition & 1 deletion src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void Player::recreate_stream_adapted_to_current_audio_data()
&_parameters,
nullptr, // No input stream needed
RTAUDIO_FLOAT32,
_data.sample_rate, // TODO(Audio-Philippe) Resample the audio data to make it match the preferredSampleRate of the device. The current strategy works, unless the device does not support the sample_rate used by our audio data, in which case the audio will be played too slow or too fast.
_data.sample_rate, // TODO(Audio) Resample the audio data to make it match the preferredSampleRate of the device. The current strategy works, unless the device does not support the sample_rate used by our audio data, in which case the audio will be played too slow or too fast.
&nb_frames_per_callback,
&audio_callback,
this
Expand Down
2 changes: 1 addition & 1 deletion src/compute_volume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ auto compute_volume(std::span<float const> data) -> float
{
if (data.empty())
return 0.f;
// TODO(Audio-Philippe) Implement a much smarter loudness computation like https://github.com/klangfreund/LUFSMeter/tree/master
// TODO(Audio) Implement a much smarter loudness computation like https://github.com/klangfreund/LUFSMeter/tree/master
float sum_of_squares{0.f};
for (float const sample : data)
sum_of_squares += sample * sample;
Expand Down
2 changes: 1 addition & 1 deletion src/fourier_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ auto fourier_transform(size_t samples_count, ForEachSample const& for_each_sampl
auto fft_output = dj::fft1d(fft_input, dj::fft_dir::DIR_FWD);
float const delta_between_frequencies{audio_data_sample_rate / static_cast<float>(fft_output.size())}; // The values in the `fft_output` correspond to frequencies between 0 and sample_rate, evenly spaced.

// TODO(Audio-Philippe) Instead of computing the fft on a signal with many samples, and then resizing it to fit the requested `max_output_frequency_in_hz`, we could reduce it's sample rate before computing the fft, to minimize the number of frequencies that are computed for nothing (since they will be discarded afterwards anyways).
// TODO(Audio) Instead of computing the fft on a signal with many samples, and then resizing it to fit the requested `max_output_frequency_in_hz`, we could reduce it's sample rate before computing the fft, to minimize the number of frequencies that are computed for nothing (since they will be discarded afterwards anyways).

// Ignore the redondant information and the frequencies that are above max_frequency_in_hz.
{
Expand Down

0 comments on commit 445262f

Please sign in to comment.