diff --git a/examples/sound/Sound.cpp b/examples/sound/Sound.cpp index e71aa0d0..25162d4f 100644 --- a/examples/sound/Sound.cpp +++ b/examples/sound/Sound.cpp @@ -90,6 +90,9 @@ int main() // Play music from an ogg file playMusic("orchestral.ogg"); + // Play music from an opus file + playMusic("error.opus"); + // Play music from a flac file playMusic("ding.flac"); diff --git a/examples/sound/resources/error.opus b/examples/sound/resources/error.opus new file mode 100644 index 00000000..b3197dd1 Binary files /dev/null and b/examples/sound/resources/error.opus differ diff --git a/include/SFML/Audio/InputSoundFile.hpp b/include/SFML/Audio/InputSoundFile.hpp index 4c9eb951..447f10f0 100644 --- a/include/SFML/Audio/InputSoundFile.hpp +++ b/include/SFML/Audio/InputSoundFile.hpp @@ -63,7 +63,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Open a sound file from the disk for reading /// - /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, Opus and FLAC. /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. /// /// \param filename Path of the sound file to load @@ -76,7 +76,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Open a sound file in memory for reading /// - /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, Opus and FLAC. /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. /// /// \param data Pointer to the file data in memory @@ -90,7 +90,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Open a sound file from a custom stream for reading /// - /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, Opus and FLAC. /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. /// /// \param stream Source stream to read from diff --git a/tools/android/compile_libs.sh b/tools/android/compile_libs.sh old mode 100755 new mode 100644 index deadac5d..a66bb751 --- a/tools/android/compile_libs.sh +++ b/tools/android/compile_libs.sh @@ -48,6 +48,11 @@ rm $DESTDIR/$1/usr/lib/libFLAC*.so* cd $LOCALDIR/build/libvorbis-* && sed -i 's/-version-info/-avoid-version/g' lib/Makefile.in lib/Makefile.am && ./configure $HOST $PREFIX --enable-shared=no && make && make install rm $DESTDIR/$1/usr/lib/libvorbis*.so* +# Compile OPUS and OPUSFILE +cd $LOCALDIR/build/opus-* && sed -i '-version-info/-avoid-version/g' Makefile.in Makefile.am && ./configure $HOST $PREFIX --enabled-shared=no && make && make install +cd $LOCALDIR/build/opusfile-* && sed -i '-version-info/-avoid-version/g' Makefile.in Makefile.am && ./configure $HOST $PREFIX --enabled-shared=no && make && make install +rm $DESTDIR/$1/usr/lib/libopus*.so* + # Compile freetype cd $LOCALDIR/build/freetype-* && sed -i 's/-version-info/-avoid-version/g' builds/unix/unix-cc.in && ./configure $HOST $PREFIX && make && make install diff --git a/tools/android/download_sources.sh b/tools/android/download_sources.sh old mode 100755 new mode 100644 index 27c75eb4..4a1d9e6c --- a/tools/android/download_sources.sh +++ b/tools/android/download_sources.sh @@ -3,10 +3,14 @@ FLAC_VERSION=1.2.1 VORBIS_VERSION=1.3.3 OGG_VERSION=1.3.1 +OPUS_VERSION=1.1.2 +OPUSFILE_VERSION=0.7 FLAC=flac-$FLAC_VERSION VORBIS=libvorbis-$VORBIS_VERSION OGG=libogg-$OGG_VERSION +OPUS=opus-$OPUS_VERSION +OPUSFILE=opusfile-$OPUSFILE_VERSION SNDFILE_VERSION=1.0.25 SNDFILE=libsndfile-$SNDFILE_VERSION @@ -34,6 +38,18 @@ then tar -C build -xf src/$OGG.tar.gz fi +wget -nc -P src http://downloads.xiph.org/releases/opus/$OPUS.tar.gz +if [ ! -d "$PWD/tmp/$OPUS" ] +then + tar -C build -xf src/$OPUS.tar.gz +fi + +wget -nc -P src http://downloads.xiph.org/releases/opus/$OPUSFILE.tar.gz +if [ ! -d "$PWD/tmp/$OPUSFILE" ] +then + tar -C build -xf src/$OPUSFILE.tar.gz +fi + wget -nc -P src http://download.savannah.gnu.org/releases/freetype/$FREETYPE.tar.gz if [ ! -d "$PWD/tmp/$FREETYPE" ] then