Discussion:
[Audiere-users] OutputStreamPtr returns false - cannot figure out why
Mats Aubell
2006-05-29 14:01:29 UTC
Permalink
Hi all,

This library is just what I've been looking for with its simplicity and yet
so powerful. However, I've been banging my head at the desk for some time
now, because I can't even get the sample code to work.

My main code:

AudioDevicePtr device(OpenDevice());
if(device=NULL) cout << "device is null" << endl;
OutputStreamPtr sound(WinMM(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sound returns null, and I don't know why.

The file is in the project folder, have also tried the whole C:\Documents
and Settings\Mats Aubell\..... path, no effect.
I have tried opening it with the wxPlayer, everything plays as it should.

I'm on WinXP using Visual Studio 2003.

Thanks for any help! I'll continue to bang my head into solid objects for a
while :)

Mats Aubell
Mats Aubell
2006-05-29 14:05:00 UTC
Permalink
It should say OpenSound, not WinMM in the code. My apologies.

-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av Mats Aubell
Sendt: 29. mai 2006 15:01
Til: audiere-***@lists.sourceforge.net
Emne: [Audiere-users] OutputStreamPtr returns false - cannot figure outwhy

Hi all,

This library is just what I've been looking for with its simplicity and yet
so powerful. However, I've been banging my head at the desk for some time
now, because I can't even get the sample code to work.

My main code:

AudioDevicePtr device(OpenDevice());
if(device=NULL) cout << "device is null" << endl;
OutputStreamPtr sound(WinMM(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sound returns null, and I don't know why.

The file is in the project folder, have also tried the whole C:\Documents
and Settings\Mats Aubell\..... path, no effect.
I have tried opening it with the wxPlayer, everything plays as it should.

I'm on WinXP using Visual Studio 2003.

Thanks for any help! I'll continue to bang my head into solid objects for a
while :)

Mats Aubell
GeomanNL
2006-05-29 14:31:49 UTC
Permalink
I got similar code, it looks okay, except it looks like you set device to
NULL in your code, namely here.

if(device=NULL)

----- Original Message -----
From: "Mats Aubell" <***@c2i.net>
To: <audiere-***@lists.sourceforge.net>
Sent: Monday, May 29, 2006 4:05 PM
Subject: Re: [Audiere-users] OutputStreamPtr returns false - cannot
figureoutwhy


It should say OpenSound, not WinMM in the code. My apologies.

-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av Mats Aubell
Sendt: 29. mai 2006 15:01
Til: audiere-***@lists.sourceforge.net
Emne: [Audiere-users] OutputStreamPtr returns false - cannot figure outwhy

Hi all,

This library is just what I've been looking for with its simplicity and yet
so powerful. However, I've been banging my head at the desk for some time
now, because I can't even get the sample code to work.

My main code:

AudioDevicePtr device(OpenDevice());
if(device=NULL) cout << "device is null" << endl;
OutputStreamPtr sound(WinMM(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sound returns null, and I don't know why.

The file is in the project folder, have also tried the whole C:\Documents
and Settings\Mats Aubell\..... path, no effect.
I have tried opening it with the wxPlayer, everything plays as it should.

I'm on WinXP using Visual Studio 2003.

Thanks for any help! I'll continue to bang my head into solid objects for a
while :)

Mats Aubell
Mats Aubell
2006-05-29 14:49:48 UTC
Permalink
Sorry again, some hasty written code there, but if I set it like this:

if(device!=NULL) cout << "device is null" << endl;

It also informs me that that AudioDevicePtr device(OpenDevice()); returns
false, so this is probably the main problem.

My head may have taken some permanent damage... :)



-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av GeomanNL
Sendt: 29. mai 2006 15:32
Til: audiere-***@lists.sourceforge.net
Emne: Re: [Audiere-users] OutputStreamPtr returns false - cannotfigureoutwhy

I got similar code, it looks okay, except it looks like you set device to
NULL in your code, namely here.

if(device=NULL)

----- Original Message -----
From: "Mats Aubell" <***@c2i.net>
To: <audiere-***@lists.sourceforge.net>
Sent: Monday, May 29, 2006 4:05 PM
Subject: Re: [Audiere-users] OutputStreamPtr returns false - cannot
figureoutwhy


It should say OpenSound, not WinMM in the code. My apologies.

-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av Mats Aubell
Sendt: 29. mai 2006 15:01
Til: audiere-***@lists.sourceforge.net
Emne: [Audiere-users] OutputStreamPtr returns false - cannot figure outwhy

Hi all,

This library is just what I've been looking for with its simplicity and yet
so powerful. However, I've been banging my head at the desk for some time
now, because I can't even get the sample code to work.

My main code:

AudioDevicePtr device(OpenDevice());
if(device=NULL) cout << "device is null" << endl;
OutputStreamPtr sound(WinMM(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sound returns null, and I don't know why.

The file is in the project folder, have also tried the whole C:\Documents
and Settings\Mats Aubell\..... path, no effect.
I have tried opening it with the wxPlayer, everything plays as it should.

I'm on WinXP using Visual Studio 2003.

Thanks for any help! I'll continue to bang my head into solid objects for a
while :)

Mats Aubell




_______________________________________________
Audiere-users mailing list
Audiere-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audiere-users
GeomanNL
2006-05-29 14:56:04 UTC
Permalink
the != is not correct (you should use ==) in
if(device!=NULL) cout << "device is null" << endl;


----- Original Message -----
From: "Mats Aubell" <***@c2i.net>
To: <audiere-***@lists.sourceforge.net>
Sent: Monday, May 29, 2006 4:49 PM
Subject: Re: [Audiere-users] OutputStreamPtr returns
false -cannotfigureoutwhy


Sorry again, some hasty written code there, but if I set it like this:

if(device!=NULL) cout << "device is null" << endl;

It also informs me that that AudioDevicePtr device(OpenDevice()); returns
false, so this is probably the main problem.

My head may have taken some permanent damage... :)



-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av GeomanNL
Sendt: 29. mai 2006 15:32
Til: audiere-***@lists.sourceforge.net
Emne: Re: [Audiere-users] OutputStreamPtr returns false - cannotfigureoutwhy

I got similar code, it looks okay, except it looks like you set device to
NULL in your code, namely here.

if(device=NULL)

----- Original Message -----
From: "Mats Aubell" <***@c2i.net>
To: <audiere-***@lists.sourceforge.net>
Sent: Monday, May 29, 2006 4:05 PM
Subject: Re: [Audiere-users] OutputStreamPtr returns false - cannot
figureoutwhy


It should say OpenSound, not WinMM in the code. My apologies.

-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av Mats Aubell
Sendt: 29. mai 2006 15:01
Til: audiere-***@lists.sourceforge.net
Emne: [Audiere-users] OutputStreamPtr returns false - cannot figure outwhy

Hi all,

This library is just what I've been looking for with its simplicity and yet
so powerful. However, I've been banging my head at the desk for some time
now, because I can't even get the sample code to work.

My main code:

AudioDevicePtr device(OpenDevice());
if(device=NULL) cout << "device is null" << endl;
OutputStreamPtr sound(WinMM(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sound returns null, and I don't know why.

The file is in the project folder, have also tried the whole C:\Documents
and Settings\Mats Aubell\..... path, no effect.
I have tried opening it with the wxPlayer, everything plays as it should.

I'm on WinXP using Visual Studio 2003.

Thanks for any help! I'll continue to bang my head into solid objects for a
while :)

Mats Aubell




_______________________________________________
Audiere-users mailing list
Audiere-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audiere-users




_______________________________________________
Audiere-users mailing list
Audiere-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audiere-users
Mats Aubell
2006-05-29 15:02:26 UTC
Permalink
I'm speechless... (and I need some fresh air apparently). device is ok.
sound still returns false.

Proper code:

AudioDevicePtr device(OpenDevice());
if(device==NULL) cout << "devicce is null" << endl;
OutputStreamPtr sound(OpenSound(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sorry for the mess!

-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av GeomanNL
Sendt: 29. mai 2006 15:56
Til: audiere-***@lists.sourceforge.net
Emne: Re: [Audiere-users] OutputStreamPtr returns false-cannotfigureoutwhy

the != is not correct (you should use ==) in
if(device!=NULL) cout << "device is null" << endl;


----- Original Message -----
From: "Mats Aubell" <***@c2i.net>
To: <audiere-***@lists.sourceforge.net>
Sent: Monday, May 29, 2006 4:49 PM
Subject: Re: [Audiere-users] OutputStreamPtr returns
false -cannotfigureoutwhy


Sorry again, some hasty written code there, but if I set it like this:

if(device!=NULL) cout << "device is null" << endl;

It also informs me that that AudioDevicePtr device(OpenDevice()); returns
false, so this is probably the main problem.

My head may have taken some permanent damage... :)



-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av GeomanNL
Sendt: 29. mai 2006 15:32
Til: audiere-***@lists.sourceforge.net
Emne: Re: [Audiere-users] OutputStreamPtr returns false - cannotfigureoutwhy

I got similar code, it looks okay, except it looks like you set device to
NULL in your code, namely here.

if(device=NULL)

----- Original Message -----
From: "Mats Aubell" <***@c2i.net>
To: <audiere-***@lists.sourceforge.net>
Sent: Monday, May 29, 2006 4:05 PM
Subject: Re: [Audiere-users] OutputStreamPtr returns false - cannot
figureoutwhy


It should say OpenSound, not WinMM in the code. My apologies.

-----Opprinnelig melding-----
Fra: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] På vegne av Mats Aubell
Sendt: 29. mai 2006 15:01
Til: audiere-***@lists.sourceforge.net
Emne: [Audiere-users] OutputStreamPtr returns false - cannot figure outwhy

Hi all,

This library is just what I've been looking for with its simplicity and yet
so powerful. However, I've been banging my head at the desk for some time
now, because I can't even get the sample code to work.

My main code:

AudioDevicePtr device(OpenDevice());
if(device=NULL) cout << "device is null" << endl;
OutputStreamPtr sound(WinMM(device,"zzap.wav", false));
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;

Sound returns null, and I don't know why.

The file is in the project folder, have also tried the whole C:\Documents
and Settings\Mats Aubell\..... path, no effect.
I have tried opening it with the wxPlayer, everything plays as it should.

I'm on WinXP using Visual Studio 2003.

Thanks for any help! I'll continue to bang my head into solid objects for a
while :)

Mats Aubell




_______________________________________________
Audiere-users mailing list
Audiere-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audiere-users




_______________________________________________
Audiere-users mailing list
Audiere-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audiere-users



_______________________________________________
Audiere-users mailing list
Audiere-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audiere-users
Enno Rehling
2006-06-07 07:31:35 UTC
Permalink
Post by Mats Aubell
if(sound!=NULL)sound->play; else cout << "sound is null" <<
endl;
Try sound->play();

Enno.
--
A: Because it disturbs the logical flow of a message.
Q: Why is top posting a sloppy form of writing?
Loading...