Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Audio

The Audio type allows you to add audio playback to a scene. More...

Inherits QtObject

Properties

Signals

Methods

Detailed Description

This type is part of the QtMultimedia 5.0 module.

 import QtQuick 2.0
 import QtMultimedia 5.0

 Text {
     text: "Click Me!";
     font.pointSize: 24;
     width: 150; height: 50;

     Audio {
         id: playMusic
         source: "music.wav"
     }
     MouseArea {
         id: playArea
         anchors.fill: parent
         onPressed:  { playMusic.play() }
     }
 }

See also Video.

Property Documentation

autoLoad : bool

This property indicates if loading of media should begin immediately.

Defaults to true, if false media will not be loaded until playback is started.


autoPlay : bool

This property controls whether the media will begin to play on start up.

Defaults to false, if set true the value of autoLoad will be overwritten to true.


read-onlyavailability : enumeration

Returns the availability state of the media player.

This is one of:

ValueDescription
AvailableThe media player is available to use.
BusyThe media player is usually available, but some other process is utilizing the hardware necessary to play media.
UnavailableThere are no supported media playback facilities.
ResourceMissingThere is one or more resources missing, so the media player cannot be used. It may be possible to try again at a later time.

read-onlybufferProgress : real

This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0 (full).


read-onlyduration : int

This property holds the duration of the media in milliseconds.

If the media doesn't have a fixed duration (a live stream for example) this will be 0.


read-onlyerror : enumeration

This property holds the error state of the audio. It can be one of:

ValueDescription
NoErrorThere is no current error.
ResourceErrorThe audio cannot be played due to a problem allocating resources.
FormatErrorThe audio format is not supported.
NetworkErrorThe audio cannot be played due to network issues.
AccessDeniedThe audio cannot be played due to insufficient permissions.
ServiceMissingThe audio cannot be played because the media service could not be instantiated.

read-onlyerrorString : string

This property holds a string describing the current error condition in more detail.


read-onlyhasAudio : bool

This property holds whether the media contains audio.


read-onlyhasVideo : bool

This property holds whether the media contains video.


read-onlymetaData.albumArtist : variant

This property holds the name of the principal artist of the album the media belongs to.

See also QtMultimedia::MetaData::AlbumArtist.


read-onlymetaData.albumTitle : variant

This property holds the title of the album the media belongs to.

See also QtMultimedia::MetaData::AlbumTitle.


read-onlymetaData.audioBitRate : variant

This property holds the bit rate of the media's audio stream in bits per second.

See also QtMultimedia::MetaData::AudioBitRate.


read-onlymetaData.audioCodec : variant

This property holds the encoding of the media audio stream.

See also QtMultimedia::MetaData::AudioCodec.


read-onlymetaData.author : variant

This property holds the author of the media.

See also QtMultimedia::MetaData::Author.


read-onlymetaData.averageLevel : variant

This property holds the average volume level of the media.

See also QtMultimedia::MetaData::AverageLevel.


read-onlymetaData.category : variant

This property holds the category of the media

See also QtMultimedia::MetaData::Category.


read-onlymetaData.channelCount : variant

This property holds the number of channels in the media's audio stream.

See also QtMultimedia::MetaData::ChannelCount.


read-onlymetaData.chapterNumber : variant

This property holds the chapter number of the media.

See also QtMultimedia::MetaData::ChapterNumber.


read-onlymetaData.comment : variant

This property holds a user comment about the media.

See also QtMultimedia::MetaData::Comment.


read-onlymetaData.composer : variant

This property holds the composer of the media.

See also QtMultimedia::MetaData::Composer.


read-onlymetaData.conductor : variant

This property holds the conductor of the media.

See also QtMultimedia::MetaData::Conductor.


read-onlymetaData.contributingArtist : variant

This property holds the names of artists contributing to the media.

See also QtMultimedia::MetaData::ContributingArtist.


read-onlymetaData.copyright : variant

This property holds the media's copyright notice.

See also QtMultimedia::MetaData::Copyright.


read-onlymetaData.coverArtUrlLarge : variant

This property holds the URL of a large cover art image.

See also QtMultimedia::MetaData::CoverArtUrlLarge.


read-onlymetaData.coverArtUrlSmall : variant

This property holds the URL of a small cover art image.

See also QtMultimedia::MetaData::CoverArtUrlSmall.


read-onlymetaData.date : variant

This property holds the date of the media.

See also QtMultimedia::MetaData::Date.


read-onlymetaData.description : variant

This property holds a description of the media.

See also QtMultimedia::MetaData::Description.


read-onlymetaData.director : variant

This property holds the director of the media.

See also QtMultimedia::MetaData::Director.


read-onlymetaData.genre : variant

This property holds the genre of the media.

See also QtMultimedia::MetaData::Genre.


read-onlymetaData.keywords : variant

This property holds a list of keywords describing the media.

See also QtMultimedia::MetaData::Keywords.


read-onlymetaData.language : variant

This property holds the language of the media, as an ISO 639-2 code.

See also QtMultimedia::MetaData::Language.


read-onlymetaData.leadPerformer : variant

This property holds the lead performer in the media.

See also QtMultimedia::MetaData::LeadPerformer.


read-onlymetaData.lyrics : variant

This property holds the lyrics to the media.

See also QtMultimedia::MetaData::Lyrics.


read-onlymetaData.mediaType : variant

This property holds the type of the media.

See also QtMultimedia::MetaData::MediaType.


read-onlymetaData.mood : variant

This property holds the mood of the media.

See also QtMultimedia::MetaData::Mood.


read-onlymetaData.parentalRating : variant

This property holds the parental rating of the media.

See also QtMultimedia::MetaData::ParentalRating.


read-onlymetaData.peakValue : variant

This property holds the peak volume of media's audio stream.

See also QtMultimedia::MetaData::PeakValue.


read-onlymetaData.pixelAspectRatio : variant

This property holds the pixel aspect ratio of an image or video.

See also QtMultimedia::MetaData::PixelAspectRatio.


read-onlymetaData.posterUrl : variant

This property holds the URL of a poster image.

See also QtMultimedia::MetaData::PosterUrl.


read-onlymetaData.publisher : variant

This property holds the publisher of the media.

See also QtMultimedia::MetaData::Publisher.


read-onlymetaData.ratingOrganization : variant

This property holds the name of the rating organization responsible for the parental rating of the media.

See also QtMultimedia::MetaData::RatingOrganization.


read-onlymetaData.resolution : variant

This property holds the dimension of an image or video.

See also QtMultimedia::MetaData::Resolution.


read-onlymetaData.sampleRate : variant

This property holds the sample rate of the media's audio stream in hertz.

See also QtMultimedia::MetaData::SampleRate.


read-onlymetaData.size : variant

This property property holds the size of the media in bytes.

See also QtMultimedia::MetaData::Size.


read-onlymetaData.subTitle : variant

This property holds the sub-title of the media.

See also QtMultimedia::MetaData::SubTitle.


read-onlymetaData.title : variant

This property holds the tile of the media.

See also QtMultimedia::MetaData::Title.


read-onlymetaData.trackCount : variant

This property holds the number of tracks on the album containing the media.

See also QtMultimedia::MetaData::TrackNumber.


read-onlymetaData.trackNumber : variant

This property holds the track number of the media.

See also QtMultimedia::MetaData::TrackNumber.


read-onlymetaData.userRating : variant

This property holds a user rating of the media in the range of 0 to 100.

See also QtMultimedia::MetaData::UserRating.


read-onlymetaData.videoBitRate : variant

This property holds the bit rate of the media's video stream in bits per second.

See also QtMultimedia::MetaData::VideoBitRate.


read-onlymetaData.videoCodec : variant

This property holds the encoding of the media's video stream.

See also QtMultimedia::MetaData::VideoCodec.


read-onlymetaData.videoFrameRate : variant

This property holds the frame rate of the media's video stream.

See also QtMultimedia::MetaData::VideoFrameRate.


read-onlymetaData.writer : variant

This property holds the writer of the media.

See also QtMultimedia::MetaData::Writer.


read-onlymetaData.year : variant

This property holds the year of release of the media.

See also QtMultimedia::MetaData::Year.


muted : bool

This property holds whether the audio output is muted.

Defaults to false.


playbackRate : real

This property holds the rate at which audio is played at as a multiple of the normal rate.

Defaults to 1.0.


read-onlyplaybackState : enumeration

This property holds the state of media playback. It can be one of:

  • PlayingState - the media is currently playing.
  • PausedState - playback of the media has been suspended.
  • StoppedState - playback of the media is yet to begin.

position : int

This property holds the current playback position in milliseconds.

If the seekable property is true, this property can be set to seek to a new position.


read-onlyseekable : bool

This property holds whether position of the audio can be changed.

If true; setting a position value will cause playback to seek to the new position.


source : url

This property holds the source URL of the media.


read-onlystatus : enumeration

This property holds the status of media loading. It can be one of:

  • NoMedia - no media has been set.
  • Loading - the media is currently being loaded.
  • Loaded - the media has been loaded.
  • Buffering - the media is buffering data.
  • Stalled - playback has been interrupted while the media is buffering data.
  • Buffered - the media has buffered data.
  • EndOfMedia - the media has played to the end.
  • InvalidMedia - the media cannot be played.
  • UnknownStatus - the status of the media is unknown.

volume : real

This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume).

Defaults to 1.0.


Signal Documentation

Audio::error(error, errorString)

This handler is called when an error has occurred. The errorString parameter may contain more detailed information about the error.


Audio::paused()

This handler is called when playback is paused.


Audio::playbackStateChanged()

This handler is called when the playbackState property is altered.


Audio::playing()

This handler is called when playback is started or resumed.


Audio::stopped()

This handler is called when playback is stopped.


Method Documentation

Audio::pause()

Pauses playback of the media.

Sets the playbackState property to PausedState.


Audio::play()

Starts playback of the media.

Sets the playbackState property to PlayingState.


Audio::stop()

Stops playback of the media.

Sets the playbackState property to StoppedState.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web