mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
sound: Add sample rate as a parameter for square wave
At present this value is hard-coded in the function that generates a square wave. Since sample rates vary between different hardware, it makes more sense to have this as a parameter. Update the function and its users. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -31,11 +31,13 @@ struct sound_codec_info {
|
||||
/*
|
||||
* Generates square wave sound data for 1 second
|
||||
*
|
||||
* @param sample_rate Sample rate in Hz
|
||||
* @param data data buffer pointer
|
||||
* @param size size of the buffer
|
||||
* @param freq frequency of the wave
|
||||
*/
|
||||
void sound_create_square_wave(unsigned short *data, int size, uint32_t freq);
|
||||
void sound_create_square_wave(uint sample_rate, unsigned short *data, int size,
|
||||
uint freq);
|
||||
|
||||
/*
|
||||
* Initialises audio sub system
|
||||
|
||||
Reference in New Issue
Block a user