59 lines
1.2 KiB
Objective-C
59 lines
1.2 KiB
Objective-C
//
|
|
// SoundFile.h
|
|
// Cog
|
|
//
|
|
// Created by Vincent Spader on 1/15/05.
|
|
// Copyright 2005 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <CoreAudio/AudioHardware.h>
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
#import <AudioUnit/AudioUnit.h>
|
|
|
|
#import "DBLog.h"
|
|
|
|
@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
|
|
|
|
- (int)fillBuffer:(void *)buf ofSize:(UInt32)size;
|
|
|
|
//- (BOOL)seek:(unsigned long)position;
|
|
- (double)seekToTime:(double)milliseconds;
|
|
- (void)close;
|
|
- (void)reset; //START AGAIN
|
|
|
|
- (UInt16)channels;
|
|
- (UInt16)bitsPerSample;
|
|
- (UInt32)frequency;
|
|
-(BOOL)isBigEndian;
|
|
-(BOOL)isUnsigned;
|
|
|
|
@end
|