IOS SOUND IMAGE: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Add "cleanup" tag)
(Convert ExpressionEngine links)
Line 4: Line 4:


For to play sound file on IOS platform you can't store in qrc file but you must put it in the bundle together the qml files.
For to play sound file on IOS platform you can't store in qrc file but you must put it in the bundle together the qml files.
Here "https://github.com/niqt/iosqt":https://github.com/niqt/iosqt you can find my example that plays sound on IOS.
Here [https://github.com/niqt/iosqt https://github.com/niqt/iosqt] you can find my example that plays sound on IOS.
The most important part is this (in .pro file), where puts the qml and audio in the bundle:
The most important part is this (in .pro file), where puts the qml and audio in the bundle:



Revision as of 15:01, 4 March 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

h1. IOS sound and image

For to play sound file on IOS platform you can't store in qrc file but you must put it in the bundle together the qml files. Here https://github.com/niqt/iosqt you can find my example that plays sound on IOS. The most important part is this (in .pro file), where puts the qml and audio in the bundle:

DATA_FILES = $$PWD/qml/iosqt/main.qml  ../iosqt/page.qml  ../iosqt/audio.mp3

ios: {

data.files = $$DATA_FILES
 data.path = Documents
 QMAKE_BUNDLE_DATA ''= data
 }

obviously you have to include the plugin:

QTPLUGIN''= qtaudio_coreaudio
QTPLUGIN ''= qtmedia_audioengine
QTPLUGIN''= qavfcamera
QTPLUGIN += qavfmediaplayer

thus in main.qml:

MediaPlayer {
 id: playMusic
 volume: 0.5
 source: "audio.mp3"
 }

Good fun