Skip to content

Sample rate

Brecht De Man edited this page Nov 17, 2020 · 4 revisions

Depending on how the experiment is set up, audio is resampled automatically (the Web Audio default) or the sample rate is enforced. In the latter case, you will need to make sure that the sample rate of the system is equal to the sample rate of these audio files. For this reason, all audio files in the experiment will have to have the same sample rate. Always make sure that all other digital equipment in the playback chain (clock, audio interface, digital-to-analog converter, ...) is set to this same sample rate. Note that upon changing the sampling rate, the browser will have to be restarted for the change to take effect.

OS X

To change the sample rate in Mac OS X, go to Applications/Utilities/Audio MIDI Setup or find this application with Spotlight. Then select the output of the audio interface you are using and change the 'Format' to the appropriate number. Also make sure the bit depth and channel count are as desired. If you are using an external audio interface, you may have to go to the preference pane of that device to change the sample rate. audiomidisetup

Also make sure left and right channel gains are equal, as some applications alter this without changing it back, leading to a predominantly louder left or right channel. See above for an example where the channel gains are different.

Windows

To change the sample rate in Windows, right-click on the speaker icon in the lower-right corner of your desktop and choose 'Playback devices'. Right-click the appropriate playback device and click 'Properties'. Click the 'Advanced' tab and verify or change the sample rate under 'Default Format'. If you are using an external audio interface, you may have to go to the preference pane of that device to change the sample rate.

Clone this wiki locally