summaryrefslogtreecommitdiff
path: root/include/sound.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-15 19:56:13 -0700
committerSimon Glass <sjg@chromium.org>2018-11-29 09:30:05 -0700
commit7d92b0609093a047ce4b113d77ccd3cc78325e8f (patch)
tree4afa25f53b27bf4f76cac7e0a80ef8bb1de36242 /include/sound.h
parent03f11e87a86307903f40e74495936184063bab79 (diff)
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>
Diffstat (limited to 'include/sound.h')
-rw-r--r--include/sound.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sound.h b/include/sound.h
index 3269f2371c..77bfe6a93b 100644
--- a/include/sound.h
+++ b/include/sound.h
@@ -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