Initial support for WAV parsing
This commit is contained in:
@@ -2,6 +2,30 @@
|
||||
#define LIME_AUDIO_SOUND_H
|
||||
|
||||
|
||||
#include <hx/CFFI.h>
|
||||
#include <utils/ByteArray.h>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
#define LOG_SOUND(args,...) ELOG(args, ##__VA_ARGS__)
|
||||
#else
|
||||
#ifdef IPHONE
|
||||
//#define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__)
|
||||
#define LOG_SOUND(args...) { }
|
||||
#elif defined(TIZEN)
|
||||
#include <FBase.h>
|
||||
#define LOG_SOUND(args,...) AppLog(args, ##__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__)
|
||||
#endif
|
||||
#endif
|
||||
//#define LOG_SOUND(args...) { }
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
|
||||
@@ -10,6 +34,20 @@ namespace lime {
|
||||
|
||||
public:
|
||||
|
||||
Sound ();
|
||||
~Sound ();
|
||||
|
||||
value Value ();
|
||||
|
||||
int bitsPerSample;
|
||||
int channels;
|
||||
int sampleRate;
|
||||
ByteArray *data;
|
||||
|
||||
private:
|
||||
|
||||
value mValue;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -9,6 +9,37 @@
|
||||
namespace lime {
|
||||
|
||||
|
||||
struct RIFF_Header {
|
||||
|
||||
char chunkID[4];
|
||||
unsigned int chunkSize; //size not including chunkSize or chunkID
|
||||
char format[4];
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct WAVE_Format {
|
||||
|
||||
char subChunkID[4];
|
||||
unsigned int subChunkSize;
|
||||
short audioFormat;
|
||||
short numChannels;
|
||||
unsigned int sampleRate;
|
||||
unsigned int byteRate;
|
||||
short blockAlign;
|
||||
short bitsPerSample;
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct WAVE_Data {
|
||||
|
||||
char subChunkID[4]; //should contain the word data
|
||||
unsigned int subChunkSize; //Stores the size of the data block
|
||||
|
||||
};
|
||||
|
||||
|
||||
class WAV {
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,14 @@ namespace lime {
|
||||
Image ();
|
||||
~Image ();
|
||||
|
||||
void Resize (int width, int height, int bpp = 4);
|
||||
void Blit (const unsigned char *data, int x, int y, int width, int height);
|
||||
void Resize (int width, int height, int bpp = 4);
|
||||
value Value ();
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int bpp; // bytes per pixel
|
||||
int bpp;
|
||||
ByteArray *data;
|
||||
|
||||
int height;
|
||||
int width;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user