ソースを参照

Build wav2sketch for Windows

dds
PaulStoffregen 11年前
コミット
a50017b4c4
2個のファイルの変更8行の追加2行の削除
  1. +8
    -2
      examples/PlayFromSketch/wav2sketch/wav2sketch.c
  2. バイナリ
      examples/PlayFromSketch/wav2sketch/wav2sketch.exe

+ 8
- 2
examples/PlayFromSketch/wav2sketch/wav2sketch.c ファイルの表示

// THE SOFTWARE. // THE SOFTWARE.


// compile with: gcc -O2 -Wall -o wav2sketch wav2sketch.c // compile with: gcc -O2 -Wall -o wav2sketch wav2sketch.c
// i686-w64-mingw32-gcc -s -O2 -Wall wav2sketch.c -o wav2sketch.exe


#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h> #include <dirent.h>


uint8_t ulaw_encode(int16_t audio); uint8_t ulaw_encode(int16_t audio);
{ {
DIR *dir; DIR *dir;
struct dirent *f; struct dirent *f;
struct stat s;
FILE *fp, *outc=NULL, *outh=NULL; FILE *fp, *outc=NULL, *outh=NULL;
char buf[128]; char buf[128];
int i, len; int i, len;
while (1) { while (1) {
f = readdir(dir); f = readdir(dir);
if (!f) break; if (!f) break;
if ((f->d_type & DT_DIR)) continue; // skip directories
if (!(f->d_type & DT_REG)) continue; // skip special files
//if ((f->d_type & DT_DIR)) continue; // skip directories
//if (!(f->d_type & DT_REG)) continue; // skip special files
if (stat(f->d_name, &s) < 0) continue; // skip if unable to stat
if (S_ISDIR(s.st_mode)) continue; // skip directories
if (!S_ISREG(s.st_mode)) continue; // skip special files
filename = f->d_name; filename = f->d_name;
len = strlen(filename); len = strlen(filename);
if (len < 5) continue; if (len < 5) continue;

バイナリ
examples/PlayFromSketch/wav2sketch/wav2sketch.exe ファイルの表示


読み込み中…
キャンセル
保存