Re: [osg-users] Play audio files

2012-04-12 Thread Héctor Martínez
Hello again,

I know that is has been long time since the last message about this topic,
but I am still facing the same issue. The audio is still delayed in the
videos.
But now I have found that if I change

ulBufferSize = (ulFrequency * bytesPerSample)  2;

by this

ulBufferSize = (ulFrequency * bytesPerSample)  4;

in the AudioSink.h file, the delay disappears in some videos. I don't
understand quite well why it disappears and why it is only in some videos.
The thing is that in one mpg video, the delay has completely disappeared,
while with one flv video the delay has not disappeared, but has been
reduced. If I convert that flv video to mpg, the delay remain the same, so I
actually don't know if the problem is with the video format, the AduioSink
buffer, or if it is about the libraries (osgAudio, openAL, ffmpeg...).

I have tested with openAL soft and with openAL and I am getting the same
behaviour with both.

Anybody has any idea about this problem? Maybe the buffer change can give
the clue to solve it.

Thank you in advance.


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Héctor
Martínez
Sent: viernes, 27 de enero de 2012 12:31
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Play audio files

Thank you Chris for your reply.

I am still trying to solve the problems. One thing that have helped me is
changing this line:

AudioSink(osg::AudioStream* audioStream): _started(false), _paused(false),
_audioStream(audioStream) {play();}

for this line:

AudioSink(osg::AudioStream* audioStream): _started(false), _paused(false),
_audioStream(audioStream) {}

I don't know if there is a logical reason for that, but when deleting the
play(), the cutting in the audio seems to disappear. OK, it still makes some
cuts, but they are very small and it is possible to hear the audio without
problems (with the previous cuts it was impossible to hear the audio).

But I am still facing the problem of the delay. The audio starts delayed for
some reason that I can't still figure out. Could it be because I am using
openAL soft instead of openAL? Maybe that's not the problem, because it is
working fine with audio files, but who knows...

Best regards

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris
'Xenon' Hanson
Sent: jueves, 26 de enero de 2012 18:04
To: OpenSceneGraph Users
Subject: Re: [osg-users] Play audio files

On 1/26/2012 2:45 AM, Héctor Martínez wrote:
 Hi Laurens,
 If anyone can give an idea about the problem, you are welcome.

  I'd love to help you, but I only wrote the FMOD side of osgAudio -- the
openAL/openalpp side was part of osgAL, and I never really worked with it
because I couldn't get openAL to work on my Vista box at the time.

--
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting.
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist.
- Xen ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-27 Thread Héctor Martínez
Thank you Chris for your reply.

I am still trying to solve the problems. One thing that have helped me is
changing this line:

AudioSink(osg::AudioStream* audioStream): _started(false), _paused(false),
_audioStream(audioStream) {play();}

for this line:

AudioSink(osg::AudioStream* audioStream): _started(false), _paused(false),
_audioStream(audioStream) {}

I don't know if there is a logical reason for that, but when deleting the
play(), the cutting in the audio seems to disappear. OK, it still makes some
cuts, but they are very small and it is possible to hear the audio without
problems (with the previous cuts it was impossible to hear the audio).

But I am still facing the problem of the delay. The audio starts delayed for
some reason that I can't still figure out. Could it be because I am using
openAL soft instead of openAL? Maybe that's not the problem, because it is
working fine with audio files, but who knows...

Best regards

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris
'Xenon' Hanson
Sent: jueves, 26 de enero de 2012 18:04
To: OpenSceneGraph Users
Subject: Re: [osg-users] Play audio files

On 1/26/2012 2:45 AM, Héctor Martínez wrote:
 Hi Laurens,
 If anyone can give an idea about the problem, you are welcome.

  I'd love to help you, but I only wrote the FMOD side of osgAudio -- the
openAL/openalpp side was part of osgAL, and I never really worked with it
because I couldn't get openAL to work on my Vista box at the time.

--
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting.
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist.
- Xen ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-26 Thread Héctor Martínez
Hi Laurens,

thank you for your reply. I still have the same problem. I can't figure out
why this is happening. With SDL it was working fine (without delays and cuts
in the audio). The strange thing is that if the video finishes and starts
again, the audio doesn't sound with cuts (until it goes to pause again).
On the other hand, I don't get this problem when playing audio files instead
of video files.

If anyone can give an idea about the problem, you are welcome.

Best regards

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Laurens
Voerman
Sent: martes, 24 de enero de 2012 16:49
To: OpenSceneGraph Users
Subject: Re: [osg-users] Play audio files

Hi Héctor,

I have no solution, our software just calls pause() from osg::ImageStream,
and has the same stuttering on restart.

Laurens.

On 1/24/2012 10:32 AM, Héctor Martínez wrote:
 Thank you Mattias and Laurens. I am testing the code you (Laurens) 
 have attached and it is working, but the audio is not synchronized and 
 if I pause the audio and then I play again, it seems that it plays 
 some kind of buffered audio and then the audio begins to sound with cuts.
 I am trying to find the reason of this behavior, but I write it here 
 in case you now the solution.

 Best regards.

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
 Laurens Voerman
 Sent: lunes, 23 de enero de 2012 15:12
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Play audio files

 Hi All,

 I have ffmpeg movie audio working with osgAudio, but have been to busy 
 to clean up the code, create an example and submit  for inclusion in 
 the osgAudio library. To avoid duplicate work I attach my current code as
is.
 Currently this is working part of our program, running both on linux
 (AMD64) and win7 (x64) . It compiles and runs on Win32 x86 but is 
 probably never tested.

 attached is a zipfile with AudioSink.h

 example should be a variation on osgMovie, but should be in the 
 osgAudio library, because osgAudio depends on osg.

 Laurens.

 Quick cut and paste from our program to show how to use this 'audioSink':

 // includes:
 #define OV_EXCLUDE_STATIC_CALLBACKS
 #includeosgAudio/SoundManager.h
 #includeosgAudio/SoundRoot.h

 #include AudioSink.h
 //init
   osgAudio::SoundManager::instance()-init( 16 );

 osgAudio::SoundManager::instance()-getEnvironment()-setDistanceModel
 (osgAu
 dio::InverseDistance);

 osgAudio::SoundManager::instance()-getEnvironment()-setDopplerFactor
 (1);

   if (!noAudio) {
   _sceneRootGroup-addChild(new osgAudio::SoundRoot);
   }
 // play movie audio
   osg::ImageStream::AudioStreams  audioStreams =
 ffstream-getAudioStreams();
   if (_playAudio  (!audioStreams.empty())
 audioStreams[0].valid())
   {
   osg::AudioStream* audioStream =
audioStreams[0].get();
   osg::notify(osg::NOTICE)AudioStream read 
 [audioStream-getName()]std::endl;
   osgRCAudio::AudioSink *sink;
   try {
   sink = new osgAudio::AudioSink(audioStream);
   }
   catch (...)
   {
   osg::notify(osg::WARN)  new AudioSink 
 failed  std::endl;
   }
   audioStream-setAudioSink(sink);
   }
 // cleanup
   osgAudio::SoundManager *sndMgr = osgAudio::SoundManager::instance();
   if (sndMgr-initialized()) sndMgr-shutdown();

   if (osg::Referenced::getDeleteHandler())
   {

 osg::Referenced::getDeleteHandler()-setNumFramesToRetainObjects(0);
   osg::Referenced::getDeleteHandler()-flushAll();
   }


 On 1/23/2012 11:22 AM, Mattias Helsing wrote:
 Hello Héctor

 You need to extend osg::AudioSink with the osgAudio code that you 
 have working. Have a look at the osgmovie exemple. It (optionally) 
 implements the osg::AudioSink interface using SDL. You need to do it 
 using osgAudio (or whatever sound backend you prefer).

 cheers
 Mattias

 2012/1/23 Héctor Martínezhector.marti...@sensetrix.com:
 Hi,


 Now, the following question: is there a straight way to connect the 
 audio from a video to osgAudio? I am using the ffmpeg plugin to read 
 the videos and I get audioStreams as it is done in the osgmovie example.

 Thank you in advance.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
 org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
 org

Re: [osg-users] Play audio files

2012-01-26 Thread Chris 'Xenon' Hanson
On 1/26/2012 2:45 AM, Héctor Martínez wrote:
 Hi Laurens,
 If anyone can give an idea about the problem, you are welcome.

  I'd love to help you, but I only wrote the FMOD side of osgAudio -- the 
openAL/openalpp
side was part of osgAL, and I never really worked with it because I couldn't 
get openAL to
work on my Vista box at the time.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-24 Thread Héctor Martínez
Thank you Mattias and Laurens. I am testing the code you (Laurens) have
attached and it is working, but the audio is not synchronized and if I pause
the audio and then I play again, it seems that it plays some kind of
buffered audio and then the audio begins to sound with cuts.
I am trying to find the reason of this behavior, but I write it here in case
you now the solution.

Best regards.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Laurens
Voerman
Sent: lunes, 23 de enero de 2012 15:12
To: OpenSceneGraph Users
Subject: Re: [osg-users] Play audio files

Hi All,

I have ffmpeg movie audio working with osgAudio, but have been to busy to
clean up the code, create an example and submit  for inclusion in the
osgAudio library. To avoid duplicate work I attach my current code as is.
Currently this is working part of our program, running both on linux
(AMD64) and win7 (x64) . It compiles and runs on Win32 x86 but is probably
never tested.

attached is a zipfile with AudioSink.h

example should be a variation on osgMovie, but should be in the osgAudio
library, because osgAudio depends on osg.

Laurens.

Quick cut and paste from our program to show how to use this 'audioSink':

// includes:
#define OV_EXCLUDE_STATIC_CALLBACKS
#include osgAudio/SoundManager.h
#include osgAudio/SoundRoot.h

#include AudioSink.h
//init
 osgAudio::SoundManager::instance()-init( 16 );
 
osgAudio::SoundManager::instance()-getEnvironment()-setDistanceModel(osgAu
dio::InverseDistance);
 
osgAudio::SoundManager::instance()-getEnvironment()-setDopplerFactor(1);

 if (!noAudio) {
 _sceneRootGroup-addChild(new osgAudio::SoundRoot);
 }
// play movie audio
 osg::ImageStream::AudioStreams audioStreams = 
ffstream-getAudioStreams();
 if (_playAudio  (!audioStreams.empty()) 
audioStreams[0].valid())
 {
 osg::AudioStream* audioStream = audioStreams[0].get();
 osg::notify(osg::NOTICE)AudioStream read
[audioStream-getName()]std::endl;
 osgRCAudio::AudioSink *sink;
 try {
 sink = new osgAudio::AudioSink(audioStream);
 }
 catch (...)
 {
 osg::notify(osg::WARN)  new AudioSink
failed  std::endl;
 }
 audioStream-setAudioSink(sink);
 }
// cleanup
 osgAudio::SoundManager *sndMgr = osgAudio::SoundManager::instance();
 if (sndMgr-initialized()) sndMgr-shutdown();

 if (osg::Referenced::getDeleteHandler())
 {
 
osg::Referenced::getDeleteHandler()-setNumFramesToRetainObjects(0);
 osg::Referenced::getDeleteHandler()-flushAll();
 }


On 1/23/2012 11:22 AM, Mattias Helsing wrote:
 Hello Héctor

 You need to extend osg::AudioSink with the osgAudio code that you have 
 working. Have a look at the osgmovie exemple. It (optionally) 
 implements the osg::AudioSink interface using SDL. You need to do it 
 using osgAudio (or whatever sound backend you prefer).

 cheers
 Mattias

 2012/1/23 Héctor Martínezhector.marti...@sensetrix.com:
 Hi,


 Now, the following question: is there a straight way to connect the 
 audio from a video to osgAudio? I am using the ffmpeg plugin to read 
 the videos and I get audioStreams as it is done in the osgmovie example.

 Thank you in advance.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
 org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-24 Thread Laurens Voerman

Hi Héctor,

I have no solution, our software just calls pause() from 
osg::ImageStream, and has the same stuttering on restart.


Laurens.

On 1/24/2012 10:32 AM, Héctor Martínez wrote:

Thank you Mattias and Laurens. I am testing the code you (Laurens) have
attached and it is working, but the audio is not synchronized and if I pause
the audio and then I play again, it seems that it plays some kind of
buffered audio and then the audio begins to sound with cuts.
I am trying to find the reason of this behavior, but I write it here in case
you now the solution.

Best regards.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Laurens
Voerman
Sent: lunes, 23 de enero de 2012 15:12
To: OpenSceneGraph Users
Subject: Re: [osg-users] Play audio files

Hi All,

I have ffmpeg movie audio working with osgAudio, but have been to busy to
clean up the code, create an example and submit  for inclusion in the
osgAudio library. To avoid duplicate work I attach my current code as is.
Currently this is working part of our program, running both on linux
(AMD64) and win7 (x64) . It compiles and runs on Win32 x86 but is probably
never tested.

attached is a zipfile with AudioSink.h

example should be a variation on osgMovie, but should be in the osgAudio
library, because osgAudio depends on osg.

Laurens.

Quick cut and paste from our program to show how to use this 'audioSink':

// includes:
#define OV_EXCLUDE_STATIC_CALLBACKS
#includeosgAudio/SoundManager.h
#includeosgAudio/SoundRoot.h

#include AudioSink.h
//init
  osgAudio::SoundManager::instance()-init( 16 );

osgAudio::SoundManager::instance()-getEnvironment()-setDistanceModel(osgAu
dio::InverseDistance);

osgAudio::SoundManager::instance()-getEnvironment()-setDopplerFactor(1);

  if (!noAudio) {
  _sceneRootGroup-addChild(new osgAudio::SoundRoot);
  }
// play movie audio
  osg::ImageStream::AudioStreams  audioStreams =
ffstream-getAudioStreams();
  if (_playAudio  (!audioStreams.empty())
audioStreams[0].valid())
  {
  osg::AudioStream* audioStream = audioStreams[0].get();
  osg::notify(osg::NOTICE)AudioStream read
[audioStream-getName()]std::endl;
  osgRCAudio::AudioSink *sink;
  try {
  sink = new osgAudio::AudioSink(audioStream);
  }
  catch (...)
  {
  osg::notify(osg::WARN)  new AudioSink
failed  std::endl;
  }
  audioStream-setAudioSink(sink);
  }
// cleanup
  osgAudio::SoundManager *sndMgr = osgAudio::SoundManager::instance();
  if (sndMgr-initialized()) sndMgr-shutdown();

  if (osg::Referenced::getDeleteHandler())
  {

osg::Referenced::getDeleteHandler()-setNumFramesToRetainObjects(0);
  osg::Referenced::getDeleteHandler()-flushAll();
  }


On 1/23/2012 11:22 AM, Mattias Helsing wrote:

Hello Héctor

You need to extend osg::AudioSink with the osgAudio code that you have
working. Have a look at the osgmovie exemple. It (optionally)
implements the osg::AudioSink interface using SDL. You need to do it
using osgAudio (or whatever sound backend you prefer).

cheers
Mattias

2012/1/23 Héctor Martínezhector.marti...@sensetrix.com:

Hi,


Now, the following question: is there a straight way to connect the
audio from a video to osgAudio? I am using the ffmpeg plugin to read
the videos and I get audioStreams as it is done in the osgmovie example.

Thank you in advance.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-23 Thread Héctor Martínez
Hi,

thank you for your reply. I tried to use the code in the simple.cpp file
before posting here and it didn't work for me. As you have said that this is
the way to do it, I have given a second try to that code and, after some
changes and tests, I have managed to make it work, so thank you! :)

Now, the following question: is there a straight way to connect the audio
from a video to osgAudio? I am using the ffmpeg plugin to read the videos
and I get audioStreams as it is done in the osgmovie example.

Thank you in advance.

Best regards.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris
'Xenon' Hanson
Sent: viernes, 20 de enero de 2012 18:29
To: OpenSceneGraph Users
Subject: Re: [osg-users] Play audio files

On 1/20/2012 6:42 AM, Héctor Martínez wrote:
 I have downloaded and compiled osgAudio. Now I want to integrate it in 
 my own OSG-based program. So, how can I just open an audio file and 
 play it? I mean the simplest way, no need for complicated features 
 right now. Something
 like:
 open(myAudio.wav);
 playAudio();

  See examples/openal-lowlevel/simple.cpp.

osgAudio::AudioEnvironment::instance()-init();
osg::ref_ptrSource bgsound = new Source;
bgsound-stop();
osg::ref_ptrSample sample = new Sample(myAudio.wav);
bgsound-setSound(sample.get());
bgsound-setGain(0.6f);  // Lower gain (volume)
bgsound-setLooping();
bgsound-setAmbient();  // Make sound ambient (i.e. not attenuated)
bgsound-play();  // Start playing


--
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting.
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist.
- Xen ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-23 Thread Mattias Helsing
Hello Héctor

You need to extend osg::AudioSink with the osgAudio code that you have
working. Have a look at the osgmovie exemple. It (optionally)
implements the osg::AudioSink interface using SDL. You need to do it
using osgAudio (or whatever sound backend you prefer).

cheers
Mattias

2012/1/23 Héctor Martínez hector.marti...@sensetrix.com:
 Hi,


 Now, the following question: is there a straight way to connect the audio
 from a video to osgAudio? I am using the ffmpeg plugin to read the videos
 and I get audioStreams as it is done in the osgmovie example.

 Thank you in advance.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-20 Thread Héctor Martínez
Hi,

thank you for your reply, it has been very clear and it has solved all my
doubts.
I have downloaded and compiled osgAudio. Now I want to integrate it in my
own OSG-based program. So, how can I just open an audio file and play it? I
mean the simplest way, no need for complicated features right now. Something
like:

open(myAudio.wav);
playAudio();

Of course I understand that it is not so easy, but you can get an idea of
what I need at the moment.

Thank you in advance.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris
'Xenon' Hanson
Sent: jueves, 19 de enero de 2012 18:26
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Play audio files

On 1/19/2012 2:17 AM, Héctor Martínez wrote:
 I am currently using SDLaudio for playing the sound of the videos I am 
 using, but when trying to load 2 or more videos at the same time, it 
 only plays one of them (and not always). I have read that SDL only 
 allows one audio channel, so I think I have to start using something else.
I want also to play other audio files (mp3, ogg, wav, whatever).
 
 So, which is the best option right now? I have read about osgAL and 
 openAL. I don’t know which one is better with the version I am using 
 (OSG 3.0.1) or if there is a better solution to these two. Another 
 thing to consider is that I would like to work with LGPL (or similar) 
 licenses if possible. I think those libraries are LGPL, but as they depend
on additional libraries I am not sure if I can use them as LGPL or not.

  As the creator of osgAudio, I can answer this.

  osgAudio is the literal and philosophical child of osgAL. We started
osgAudio using the osgAL source, fixed a number of design and implementation
issues, added compile-time selection of audio backend (openAL or FMOD) and
polished it up. Thus, osgAudio.

  Even openAL's creator agrees that you should probably use osgAudio now,
since it has newer fixes.

  OpenAL was LGPL, now proprietary (Creative Labs):
http://en.wikipedia.org/wiki/OpenAL
  You'll have to interpret their licensing yourself.

  There is also OpenAL Soft:
http://en.wikipedia.org/wiki/OpenAL#OpenAL_Soft
  OpenAL Soft is an LGPL-licensed, cross-platform, software implementation

  FMOD is proprietary but has a non-commercial license:
http://en.wikipedia.org/wiki/FMOD
FMOD is available under multiple license schemes: FMOD Non-Commercial
License, which allows software not intended for commercial distribution to
use FMOD for free.

  You could fairly easily add support for other backends to osgAudio if you
wished, but I'm not aware of too many other 3d spatial audio toolkits.

--
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting.
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist.
- Xen ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-20 Thread Chris 'Xenon' Hanson
On 1/20/2012 6:42 AM, Héctor Martínez wrote:
 I have downloaded and compiled osgAudio. Now I want to integrate it in my
 own OSG-based program. So, how can I just open an audio file and play it? I
 mean the simplest way, no need for complicated features right now. Something
 like:
 open(myAudio.wav);
 playAudio();

  See examples/openal-lowlevel/simple.cpp.

osgAudio::AudioEnvironment::instance()-init();
osg::ref_ptrSource bgsound = new Source;
bgsound-stop();
osg::ref_ptrSample sample = new Sample(myAudio.wav);
bgsound-setSound(sample.get());
bgsound-setGain(0.6f);  // Lower gain (volume)
bgsound-setLooping();
bgsound-setAmbient();  // Make sound ambient (i.e. not attenuated)
bgsound-play();  // Start playing


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Play audio files

2012-01-19 Thread Héctor Martínez
Hi,

 

I am currently using SDLaudio for playing the sound of the videos I am
using, but when trying to load 2 or more videos at the same time, it only
plays one of them (and not always). I have read that SDL only allows one
audio channel, so I think I have to start using something else. I want also
to play other audio files (mp3, ogg, wav, whatever).

 

So, which is the best option right now? I have read about osgAL and openAL.
I don’t know which one is better with the version I am using (OSG 3.0.1) or
if there is a better solution to these two. Another thing to consider is
that I would like to work with LGPL (or similar) licenses if possible. I
think those libraries are LGPL, but as they depend on additional libraries I
am not sure if I can use them as LGPL or not.

 

Thank you in advance.

 

Best regards

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Play audio files

2012-01-19 Thread Chris 'Xenon' Hanson
On 1/19/2012 2:17 AM, Héctor Martínez wrote:
 I am currently using SDLaudio for playing the sound of the videos I am using, 
 but when
 trying to load 2 or more videos at the same time, it only plays one of them 
 (and not
 always). I have read that SDL only allows one audio channel, so I think I 
 have to start
 using something else. I want also to play other audio files (mp3, ogg, wav, 
 whatever).
 
 So, which is the best option right now? I have read about osgAL and openAL. I 
 don’t know
 which one is better with the version I am using (OSG 3.0.1) or if there is a 
 better
 solution to these two. Another thing to consider is that I would like to work 
 with LGPL
 (or similar) licenses if possible. I think those libraries are LGPL, but as 
 they depend on
 additional libraries I am not sure if I can use them as LGPL or not.

  As the creator of osgAudio, I can answer this.

  osgAudio is the literal and philosophical child of osgAL. We started osgAudio 
using the
osgAL source, fixed a number of design and implementation issues, added 
compile-time
selection of audio backend (openAL or FMOD) and polished it up. Thus, osgAudio.

  Even openAL's creator agrees that you should probably use osgAudio now, since 
it has
newer fixes.

  OpenAL was LGPL, now proprietary (Creative Labs):
http://en.wikipedia.org/wiki/OpenAL
  You'll have to interpret their licensing yourself.

  There is also OpenAL Soft:
http://en.wikipedia.org/wiki/OpenAL#OpenAL_Soft
  OpenAL Soft is an LGPL-licensed, cross-platform, software implementation

  FMOD is proprietary but has a non-commercial license:
http://en.wikipedia.org/wiki/FMOD
FMOD is available under multiple license schemes: FMOD Non-Commercial License, 
which
allows software not intended for commercial distribution to use FMOD for free.

  You could fairly easily add support for other backends to osgAudio if you 
wished, but
I'm not aware of too many other 3d spatial audio toolkits.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org