Show:

Q.Audio Class

Q.Audio objects facilitate audio functionality on various browsers. Please do not create them directly, but use the Q.audio function.

Constructor

Q.Audio

(
  • url
)

Parameters:

  • url String

    the url of the audio to load

Methods

pause Pauses the audio if it is playing

()

pause Pauses the audio if it is playing

()

play Plays the audio as soon as it is available

(
  • [from]
  • [until]
  • [removeAfterPlaying]
)

Parameters:

  • [from] Number optional

    The time, in seconds, from which to start.

  • [until] Number optional

    The time, in seconds, until which to play.

  • [removeAfterPlaying] Boolean optional

recorderInit Set recorder class

(
  • [options]
)

Parameters:

  • [options] Object optional

    Object with options

    • [onStreamReady] Function optional

      callback onStreamReady - fire when user apply access to microphones

    • [onDataAvailable] Function optional

      callback onDataAvailable - fire when audio stream encoded and redy o use

speak

(
  • text
  • [options]
)

Speak text in various browsers

Parameters:

  • text String

    specifies the text that will be spoken.

  • [options] Object optional

    An optional hash of options for Q.Audio.speak:

    • [gender="female"] String optional

      the voice in which will be speech the text.

    • [rate=1] Number optional

      the speaking rate of the SpeechSynthesizer object, from 0.1 to 1.

    • [pitch=1] Number optional

      the speaking pitch of the SpeechSynthesizer object, from 0.1 to 1.9.

    • [volume=1] Number optional

      the volume height of speech (0.1 - 1).

    • [locale="en-US"] Number optional

      a 4 character code that specifies the language that should be used to synthesize the text.