2005-06-02 18:16:43 +00:00
|
|
|
//
|
|
|
|
// SoundFile.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 1/15/05.
|
2005-07-02 21:02:06 +00:00
|
|
|
// Copyright 2005 Vincent Spader All rights reserved.
|
2005-06-02 18:16:43 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
#import <CoreAudio/AudioHardware.h>
|
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
|
|
#import <AudioUnit/AudioUnit.h>
|
|
|
|
|
|
|
|
#import "DBLog.h"
|
|
|
|
|
2006-04-21 20:43:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
BOOL hostIsBigEndian();
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-06-02 18:16:43 +00:00
|
|
|
@interface SoundFile : NSObject {
|
|
|
|
UInt16 bitsPerSample;
|
|
|
|
UInt16 channels;
|
|
|
|
UInt32 frequency;
|
|
|
|
UInt32 bitRate;
|
|
|
|
BOOL isBigEndian;
|
|
|
|
BOOL isUnsigned;
|
|
|
|
|
|
|
|
unsigned long totalSize;
|
|
|
|
unsigned long currentPosition;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (unsigned long)totalSize;
|
|
|
|
- (unsigned long)currentPosition;
|
|
|
|
|
|
|
|
- (double)length;
|
|
|
|
|
|
|
|
- (int)bitRate;
|
|
|
|
|
|
|
|
+ (SoundFile *)soundFileFromFilename:(NSString *)filename; //PRIVATE
|
|
|
|
+ (SoundFile *)open:(NSString *)filename;
|
|
|
|
+ (SoundFile *)readInfo:(NSString *)filename;
|
|
|
|
|
|
|
|
- (BOOL)open:(const char *)filename;
|
|
|
|
- (void)getFormat:(AudioStreamBasicDescription *)sourceStreamFormat;
|
|
|
|
|
|
|
|
- (BOOL)readInfo:(const char *)filename; //for getting information
|
|
|
|
|
2005-06-29 15:28:20 +00:00
|
|
|
- (int)fillBuffer:(void *)buf ofSize:(UInt32)size;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
2005-06-05 18:52:35 +00:00
|
|
|
//- (BOOL)seek:(unsigned long)position;
|
|
|
|
- (double)seekToTime:(double)milliseconds;
|
2005-06-02 18:16:43 +00:00
|
|
|
- (void)close;
|
|
|
|
- (void)reset; //START AGAIN
|
|
|
|
|
|
|
|
- (UInt16)channels;
|
|
|
|
- (UInt16)bitsPerSample;
|
|
|
|
- (UInt32)frequency;
|
|
|
|
-(BOOL)isBigEndian;
|
|
|
|
-(BOOL)isUnsigned;
|
|
|
|
|
|
|
|
@end
|