1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
Matej Jan 1ca44f0f04 Audio support added
git-svn-id: http://xni.googlecode.com/svn/XNI@50 ac433895-eea3-a490-d80a-17149a75e588
2010-12-15 08:55:39 +00:00

50 lines
1.4 KiB
Objective-C

//
// SoundEffect.h
// XNI
//
// Created by Matej Jan on 15.12.10.
// Copyright 2010 Retronator. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <OpenAL/al.h>
#import <OpenAL/alc.h>
#import "Retronator.Xni.Framework.Audio.classes.h"
@interface SoundEffect : NSObject {
@private
NSData *buffer;
int offset;
int count;
int sampleRate;
AudioChannels channels;
int loopStart;
int loopLength;
NSString *name;
NSUInteger bufferID;
}
- (id) initWithBuffer:(NSData*)theBuffer sampleRate:(int)theSampleRate channels:(AudioChannels)theChannels;
- (id) initWithBuffer:(NSData*)theBuffer offset:(int)theOffset count:(int)theCount sampleRate:(int)theSampleRate channels:(AudioChannels)theChannels loopStart:(int)theLoopStart loopLength:(int)theLoopLength;
@property (nonatomic, readonly) NSTimeInterval duration;
@property (nonatomic, retain) NSString *name;
+ (float) speedOfSound;
+ (void) setSpeedOfSound:(float)value;
+ (float) masterVolume;
+ (void) setMasterVolume:(float)value;
+ (SoundEffect*) fromStream:(NSStream*)stream;
+ (NSTimeInterval) getSampleDurationForSizeInBytes:(int)sizeInBytes sampleRate:(int)sampleRate channels:(AudioChannels)channels;
+ (int) getSampleSizeInBytesForDuration:(NSTimeInterval)duration sampleRate:(int)sampleRate channels:(AudioChannels)channels;
- (SoundEffectInstance*) createInstance;
- (BOOL) play;
- (BOOL) playWithVolume:(float)volume pitch:(float)pitch pan:(float)pan;
@end