-
-
Save zymawy/6aaa5d186019bb36ca93da51cfbb8f2b to your computer and use it in GitHub Desktop.
Loading audio files from BinaryData (JUCE/C++)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loading audio file "guitar.wav" | |
AudioFormatManager formatManager; | |
formatManager.registerBasicFormats(); | |
// normal way | |
File audioFile ("/path/to/guitar.wav"); | |
FileInputStream* input = audioFile.createInputStream(); | |
AudioFormatReader* reader = formatManager.createReaderFor (input); | |
// from the reader we can load into an audio buffer, etc... | |
// From BinaryData | |
MemoryInputStream* input = new MemoryInputStream (BinaryData::guitar_wav, BinaryData::guitar_wavSize, false); | |
AudioFormatReader* reader = formatManager.createReaderFor (input); | |
// Don't forget to clean up pointers... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment