Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lower sample rates for AudioPlaySerialflashRaw #157

Open
floretan opened this issue Jan 20, 2016 · 1 comment
Open

Support lower sample rates for AudioPlaySerialflashRaw #157

floretan opened this issue Jan 20, 2016 · 1 comment

Comments

@floretan
Copy link
Contributor

There is already an example for support for sample rates of 11.025 and 22.05 kHz in https://github.com/PaulStoffregen/Audio/blob/master/play_memory.cpp, it would be nice to add the same functionality to AudioPlaySerialflashRaw, so more data can be stored on the external memory (quite practical if you have many samples, especially if they are long).

The AudioPlayMemory implementation reads the format (sample rate & ulaw compression) from the first element in the array, that information is not present in raw files. Would it be ok it to add an optional parameter to AudioPlaySerialflashRaw->play() to specify the format (default is 44.1 kHz without ulaw), using the same values as AudioPlayMemory?

@thebiguno
Copy link

I have just made a change to PlaySerialFlashRaw to support u-law encoding (see pull request #160); the state variables are now ready to add more options. Currently it uses the filename extension to detect whether the file is raw (.RAW) or u-law (.ULW), so we would have to either come up with other file extensions for other bit rates / encodings, or muck with the play function as you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants