BNBAudioTrack

Objective-C

@interface BNBAudioTrack : NSObject

/**
 *set current audio track playback volume.
 *@param volume (float): new audio volume. must be in range [0, 1]
 */
- (void)setVolume:(float)volume;

/**@return current audio track playback volume (float) */
- (float)getVolume;

/**
 *Load audio track file. For now only supports .m4a, .ogg, .mp3 files.
 *@param file (string): absolute path for audio track file.
 */
- (void)load:(nonnull NSString *)file;

/**@return current loaded audio track (string). */
- (nonnull NSString *)getCurrentTrack;

/**cast audio_track to media parent class (media). */
- (nullable BNBMedia *)asMedia;

@end

Swift

class BNBAudioTrack : NSObject

Undocumented

  • set current audio track playback volume.

    Declaration

    Objective-C

    - (void)setVolume:(float)volume;

    Swift

    func setVolume(_ volume: Float)

    Parameters

    volume

    (float): new audio volume. must be in range [0, 1]

  • Declaration

    Objective-C

    - (float)getVolume;

    Swift

    func getVolume() -> Float

    Return Value

    current audio track playback volume (float)

  • Load audio track file. For now only supports .m4a, .ogg, .mp3 files.

    Declaration

    Objective-C

    - (void)load:(nonnull NSString *)file;

    Swift

    func load(_ file: String)

    Parameters

    file

    (string): absolute path for audio track file.

  • Declaration

    Objective-C

    - (nonnull NSString *)getCurrentTrack;

    Swift

    func getCurrentTrack() -> String

    Return Value

    current loaded audio track (string).

  • cast audio_track to media parent class (media).

    Declaration

    Objective-C

    - (nullable BNBMedia *)asMedia;

    Swift

    func asMedia() -> BNBMedia?