ios :: AVAudioPlayer
ios :: AVAudioPlayer :: contents_of
ios :: AVAudioPlayer :: defaultinit
ios :: AVAudioPlayer :: play
ios :: AVAudioPlayer :: prepare_to_play
ios :: AVAudioPlayer :: release
ios $ AVAudioPlayer :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
ios :: AVAudioPlayer :: contents_of
ios :: AVAudioPlayer :: defaultinit
cocoa :: NSObject :: defaultinit
core :: Object :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Pointer :: native_equals
core :: Object :: output_class_name
Display class name on stdout (debug only).ios :: AVAudioPlayer :: play
core :: Pointer :: premultiply_alpha
Multiply RGB values by their alpha valueios :: AVAudioPlayer :: prepare_to_play
ios :: AVAudioPlayer :: release
# Audio player playing audio from a file or from memory
private extern class AVAudioPlayer in "ObjC" `{ AVAudioPlayer *`}
super NSObject
new contents_of(url: NSObject) in "ObjC" `{
NSError *error;
AVAudioPlayer *a = [[AVAudioPlayer alloc] initWithContentsOfURL:(NSURL*)url error:&error];
if (error != nil) {
NSLog(@"Failed to load sound: %@", [error localizedDescription]);
return NULL;
}
return (__bridge AVAudioPlayer*)CFBridgingRetain(a);
`}
fun play in "ObjC" `{ [self play]; `}
fun prepare_to_play in "ObjC" `{ [self prepareToPlay]; `}
fun play_and_repare_async in "ObjC" `{
dispatch_queue_t q = dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0);
dispatch_async(q, ^{
[self play];
[self prepareToPlay];
});
`}
fun release in "ObjC" `{ CFBridgingRelease((__bridge void*)self); `}
end
lib/ios/audio.nit:67,1--95,3