forked from osoumen/C700
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAudioFile.h
More file actions
63 lines (51 loc) · 1.31 KB
/
AudioFile.h
File metadata and controls
63 lines (51 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* AudioFile.h
* C700
*
* Created by osoumen on 12/10/10.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include "C700defines.h"
#include "FileAccess.h"
class AudioFile : public FileAccess {
public:
typedef struct {
int basekey,lowkey,highkey,loop,lp,lp_end;
double srcSamplerate;
} InstData;
typedef struct {
unsigned int manufacturer;
unsigned int product;
unsigned int sample_period;
unsigned int note;
unsigned int pitch_fraction;
unsigned int smpte_format;
unsigned int smpte_offset;
unsigned int loops;
unsigned int sampler_data;
unsigned int cue_id;
unsigned int type;
unsigned int start;
unsigned int end;
unsigned int fraction;
unsigned int play_count;
} WAV_smpl;
AudioFile( const char *path, bool isWriteable );
virtual ~AudioFile();
virtual bool Load();
short *GetAudioData();
int GetLoadedSamples();
bool GetInstData( InstData *instData );
bool IsVarid(); //ロードが可能であるならtrue
private:
static const unsigned int MAXIMUM_SAMPLES = 116480*10;
static const unsigned int EXPAND_BUFFER = 4096;
short *m_pAudioData;
int mLoadedSamples;
InstData mInstData;
float mPi;
int resampling(const float *src, int srcSamples, double srcRate, short *dst, int *dstSamples, double dstRate);
float sinc(float p_x1);
};