Fix audioengine example.

- Add missing audio files
- Fix 'Unable to assign double to QVector3D' warning
- Don't show decimal part of the volume

Task-number: QTBUG-41841
Task-number: QTBUG-44304
Change-Id: Ie24284242bbac0d10bd85841932c506d7634a514
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
Yoann Lopes
2015-03-18 18:08:32 +01:00
parent 197373b2d1
commit 0cd222c9b4
5 changed files with 16 additions and 29 deletions

View File

@@ -65,7 +65,7 @@ Rectangle {
loops: Animation.Infinite loops: Animation.Infinite
running: true running: true
NumberAnimation { NumberAnimation {
duration: 8000 duration: 12000
from: 0 from: 0
to: 1 to: 1
} }
@@ -113,7 +113,7 @@ Rectangle {
} }
velocity: { velocity: {
var speed = root.twoPi * root.radius / 4; var speed = root.twoPi * root.radius / 4;
return shipSound.direction * speed; return shipSound.direction.times(speed);
} }
Component.onCompleted: shipSound.play() Component.onCompleted: shipSound.play()
@@ -137,7 +137,7 @@ Rectangle {
color: "lightgreen" color: "lightgreen"
} }
Text { Text {
text: " volume:" + volumeBar.volumeCtrl.volume * 100 +"%"; text: " volume:" + Math.round(volumeBar.volumeCtrl.volume * 100) +"%";
font.pointSize: 16; font.pointSize: 16;
font.italic: true; font.italic: true;
color: "black" color: "black"

View File

@@ -68,22 +68,18 @@ AudioEngine {
} }
AudioSample { AudioSample {
name:"fire" name:"engine"
source: "fire-03-loop.wav" source: "engine-loop.wav"
preloaded:true preloaded:true
} }
AudioSample { AudioSample {
name:"explosion" name:"horn"
source: "explosion-02.wav" source: "horn.wav"
} }
AudioSample { AudioSample {
name:"lava" name:"whistle"
source: "lava-bubbling-01.wav" source: "whistle.wav"
}
AudioSample {
name:"water"
source: "running-water-01.wav"
} }
Sound { Sound {
name:"shipengine" name:"shipengine"
@@ -91,7 +87,7 @@ AudioEngine {
category:"sfx" category:"sfx"
PlayVariation { PlayVariation {
looping:true looping:true
sample:"fire" sample:"engine"
maxGain:0.9 maxGain:0.9
minGain:0.8 minGain:0.8
} }
@@ -101,23 +97,14 @@ AudioEngine {
name:"effects" name:"effects"
category:"sfx" category:"sfx"
PlayVariation { PlayVariation {
sample:"lava" sample:"horn"
maxGain:1.5 maxGain:2.0
minGain:1.2 minGain:0.9
maxPitch:2.0
minPitch:0.5
} }
PlayVariation { PlayVariation {
sample:"explosion" sample:"whistle"
maxGain:1.1 maxGain:1.0
minGain:0.7 minGain:0.8
maxPitch:1.5
minPitch:0.5
}
PlayVariation {
sample:"water"
maxGain:1.5
minGain:1.2
} }
} }

Binary file not shown.