Last active
December 15, 2015 08:39
-
-
Save misodengaku/5232694 to your computer and use it in GitHub Desktop.
mbedのルートディレクトリに8bit unsigned RAWに変換した音声データを格納して実行
動画:http://www.youtube.com/watch?v=C1YDasSZ6lQ
This file contains hidden or 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
#include "mbed.h" | |
LocalFileSystem local("local"); | |
AnalogOut speaker(p18); | |
//Serial pc(USBTX, USBRX); | |
int main() { | |
FILE *fp; | |
int c; | |
fp = fopen("/local/hatoya.raw", "r"); | |
while((c = fgetc(fp)) != EOF) | |
{ | |
//speaker = c / 256.0;だとダメ | |
speaker.write(c / 256.0); | |
//pc.printf("%f\r\n", c / 256.0); | |
wait_us(125); | |
} | |
fclose(fp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment