Decodes, analyzes, modifies and plays MP3 files. More...
Import Statement: | import |
This QML type decodes and plays MP3 files. It can also apply signal-processing effects to the decoded data before playing. Set the effect to any instance of AudioEffect for this. To use more than one effect, use MultiEffect.
You can play a file directly by calling play() with a file name parameter. Alternatively you can use an AudioStream instance as parameter to play(). Such streams can be obtained from one of the AudioFileSelector methods. This allows using platform-native file paths, like content://
on Android.
Contains a value indicating the time the MP3Decoder spends being busy decoding audio. This is a value between 0
(never busy) and 1
(always busy).
See also busyRateAverage.
effect : AudioEffect |
An AudioEffect instance that is applied to the MP3Decoder's audio signal. The effect may alter the signal or just analyze it, based on AudioEffect::processSample()'s return value.
You can use more than 1 effect by setting this property to a MultiEffect instance.
[read-only] metaData : MP3MetaData |
Contains meta information about the currently decoding MP3 signal. This is only set if the signal contains meta data.
Contains a time interval in milliseconds since 1970/01/01
when the audio signal started playing.
Contains the current internal state of the MP3Decoder.
This property can have one of the following values:
MP3Decoder::Idle
- When the MP3Decoder is currently ready to start decoding and playing audio. In this state idle is set to true. You can call play() in this state.MP3Decoder::Playing
- When the MP3Decoder is currently decoding and playing audio. In this state running is set to true. You can call stop() in this state.MP3Decoder::Stopping
- When the MP3Decoder is currently stopping the decoding process In this state stopping is set to true. You can call neither play() nor stop() in this state. Instead wait until the state resets to Idle
first.Decode and play back an MP3 stream in the MP3Decoder.
The parameter stream can either be an MP3 file's path or an AudioStream instance.