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  · 

Sound

The Sound type allows you to define a variety of samples and parameters to be used for SoundInstance. More...

Inherits Item

This type was introduced in Qt 5.0.

Properties

Methods

  • play()
  • play(gain)
  • play(gain, pitch)
  • play(position)
  • play(position, gain)
  • play(position, gain, pitch)
  • play(position, velocity)
  • play(position, velocity, direction)
  • play(position, velocity, direction, gain)
  • play(position, velocity, direction, gain, pitch)
  • play(position, velocity, gain)
  • play(position, velocity, gain, pitch)

Detailed Description

This type is part of the QtAudioEngine 1.0 module.

Sound can be accessed through QtAudioEngine1::AudioEngine::sounds with its unique name and must be defined inside AudioEngine.

 import QtQuick 2.0
 import QtAudioEngine 1.0

 Rectangle {
     color:"white"
     width: 300
     height: 500

     AudioEngine {
         id:audioengine

         AudioSample {
             name:"explosion01"
             source: "explosion-01.wav"
         }

         AudioSample {
             name:"explosion02"
             source: "explosion-02.wav"
         }

         Sound {
             name:"explosion"
             PlayVariation {
                 sample:"explosion01"
                 minPitch: 0.8
                 maxPitch: 1.1
             }
             PlayVariation {
                 sample:"explosion01"
                 minGain: 1.1
                 maxGain: 1.5
             }
         }
     }
     MouseArea {
         anchors.fill: parent
         onPressed: {
             audioengine.sounds["explosion"].play();
         }
     }
 }

Property Documentation

attenuationModel : string

This property specifies which attenuation model this sound will apply.


category : string

This property specifies which AudioCategory this sound belongs to.


name : string

This property holds the name of Sound, must be unique among all sounds and only defined once.


playType : enumeration

This property holds the playType. It can be one of:

  • Random - randomly picks up a play variation when playback is triggered
  • Sequential - plays each variation in sequence when playback is triggered

The default value is Random.


Method Documentation

Sound::play()

Creates a new SoundInstance and starts playing. Position, direction and velocity are all set to "0,0,0".


Sound::play(gain)

Creates a new SoundInstance and starts playing with the adjusted gain. Position, direction and velocity are all set to "0,0,0".


Sound::play(gain, pitch)

Creates a new SoundInstance and starts playing with the adjusted gain and pitch. Position, direction and velocity are all set to "0,0,0".


Sound::play(position)

Creates a new SoundInstance and starts playing with specified position. Direction and velocity are all set to "0,0,0".


Sound::play(position, gain)

Creates a new SoundInstance and starts playing with specified position and adjusted gain. Direction and velocity are all set to "0,0,0".


Sound::play(position, gain, pitch)

Creates a new SoundInstance and starts playing with specified position, adjusted gain and pitch. Direction and velocity are all set to "0,0,0".


Sound::play(position, velocity)

Creates a new SoundInstance and starts playing with specified position and velocity. Direction is set to "0,0,0".


Sound::play(position, velocity, direction)

Creates a new SoundInstance and starts playing with specified position, velocity and direction.


Sound::play(position, velocity, direction, gain)

Creates a new SoundInstance and starts playing with specified position, velocity, direction and adjusted gain.


Sound::play(position, velocity, direction, gain, pitch)

Creates a new SoundInstance and starts playing with specified position, velocity, direction, adjusted gain and pitch.


Sound::play(position, velocity, gain)

Creates a new SoundInstance and starts playing with specified position, velocity and adjusted gain. Direction is set to "0,0,0".


Sound::play(position, velocity, gain, pitch)

Creates a new SoundInstance and starts playing with specified position, velocity, adjusted gain and pitch. Direction is set to "0,0,0".


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