Class SXAudioManager


  • public class SXAudioManager
    extends java.lang.Object
    音频管理器
    • Constructor Summary

      Constructors 
      Constructor Description
      SXAudioManager​(long nativeAudioManager)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getCurrentTime()
      获取当前的播放时间
      double getDuration()
      获取音轨时长
      double getMaxTrackOutPoint()
      获取音轨中音频结束时间点最大的时间
      double getOutputChannelCount()
      获取音轨输出音频的声道数
      double getOutputSampleRate()
      获取音轨输出音频的采样率
      void seek​(double time)
      当前时间跳到time对应的时间
      void setDuration​(double duration)
      设置音频的时长,如不设置则取maxTrackOutPoint()的值
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SXAudioManager

        public SXAudioManager​(long nativeAudioManager)
    • Method Detail

      • setDuration

        public void setDuration​(double duration)
        设置音频的时长,如不设置则取maxTrackOutPoint()的值
        Parameters:
        duration - 时长,单位为秒
      • getDuration

        public double getDuration()
        获取音轨时长
        Returns:
        单位为秒
      • getMaxTrackOutPoint

        public double getMaxTrackOutPoint()
        获取音轨中音频结束时间点最大的时间
        Returns:
        单位为秒
      • seek

        public void seek​(double time)
        当前时间跳到time对应的时间
        Parameters:
        time - 单位为秒
      • getCurrentTime

        public double getCurrentTime()
        获取当前的播放时间
        Returns:
        单位为秒
      • getOutputSampleRate

        public double getOutputSampleRate()
        获取音轨输出音频的采样率
        Returns:
        采样率
      • getOutputChannelCount

        public double getOutputChannelCount()
        获取音轨输出音频的声道数

        1. 默认双声道

        Returns:
        声道数