Thread View: borland.public.csharpbuilder.multimedia
5 messages
5 total messages
Started by Joe Gabriele
Wed, 29 Mar 2006 11:47
Pointing to a different structure
Author: Joe Gabriele
Date: Wed, 29 Mar 2006 11:47
Date: Wed, 29 Mar 2006 11:47
37 lines
1627 bytes
1627 bytes
Hello,
I am new to C# and the C family in general, having used Delphi for many
years. I am trying to figure out how to have an element of a buffer array
use a different structure than it's original.
Example:
I have these two declarations
public class MyStructure
{
public ushort element1;
public ushort element2;
public uint element3;
}
and
private BufferDescription d = new BufferDescription();
How would I now have d.Format point to MyStructure so that it uses the
elements in MyStructure instead of the elements in d.Format?
I have tried:
MyStructure mns = new MyStructure();
d.Format = mns;
and get the error that I cannot implicitly convert one to the other.
What am I doing wrong?
Thanks.
Joe Gabriele
Re: Pointing to a different structure
Author: Marc Rohloff TeamB
Date: Thu, 30 Mar 2006 01:00
Date: Thu, 30 Mar 2006 01:00
11 lines
1409 bytes
1409 bytes
On Wed, 29 Mar 2006 06:47:15 -0500, Joe Gabriele wrote: > private BufferDescription d = new BufferDescription(); > MyStructure mns = new MyStructure(); > d.Format = mns; What is the definition for BufferDescription? -- Marc Rohloff [TeamB] marc rohloff -at- myrealbox -dot- com
Re: Pointing to a different structure
Author: Joe Gabriele
Date: Sat, 08 Apr 2006 00:50
Date: Sat, 08 Apr 2006 00:50
29 lines
1823 bytes
1823 bytes
Hello Marc, Thanks for replying and sorry for my delay in responding as I was out of town. BufferDescription is the DirectX Sound structure into which you would load a WAV file in order to play it. The Format element of BufferDescription is the WaveFormatEx structure. I would like to replace it with a WaveFormatExtensible structure instead. I have seen C++ examples on how to do this but I have been unable to find C# examples. Joe Gabriele "Marc Rohloff [TeamB]" <"on request"> wrote in message news:1bw2ghnadam3m$.dlg@dlg.marcrohloff.com... > On Wed, 29 Mar 2006 06:47:15 -0500, Joe Gabriele wrote: > >> private BufferDescription d = new BufferDescription(); >> MyStructure mns = new MyStructure(); >> d.Format = mns; > > What is the definition for BufferDescription? > > -- > Marc Rohloff [TeamB] > marc rohloff -at- myrealbox -dot- com
Re: Pointing to a different structure
Author: Marc Rohloff TeamB
Date: Sat, 08 Apr 2006 13:28
Date: Sat, 08 Apr 2006 13:28
13 lines
1746 bytes
1746 bytes
On Fri, 7 Apr 2006 20:50:21 -0400, Joe Gabriele wrote: > BufferDescription is the DirectX Sound structure into which you would load a > WAV file in order to play it. The Format element of BufferDescription is the > WaveFormatEx structure. I would like to replace it with a > WaveFormatExtensible structure instead. Can you post the definition you're using or better yet a complete code example. It might help if you post links to what you are trying to do. -- Marc Rohloff [TeamB] marc rohloff -at- myrealbox -dot- com
Re: Pointing to a different structure
Author: Joe Gabriele
Date: Thu, 13 Apr 2006 23:20
Date: Thu, 13 Apr 2006 23:20
43 lines
2896 bytes
2896 bytes
Hello Marc, Thanks for your patience. I was trying to write an audio recorder and player that would create and play two language audio on a quad audio card. To that end, I was trying to replace the WaveFormatEx section of the DirectSound BufferDescription with a WaveFormatExtensible structure thinking I needed 3D sound (one language from the front speakers and the other from the back speakers). After some more studying, it turns out I don't have to go this route. I was able accomplish my task with a single stereo channel (English audio on the right channel and French audio on the left channel) using Managed DirectSound. I simply record each language in stereo and play both files back simultaneously. On playback, the player configures the English stream (right channel) to have the left channel volume set to 0 whereas the French stream (left channel) has the right channel volume set to 0. The outcome is one language on one side and the second language on the other. Again, thanks for your patience and help. I am closing this thread but will be opening another on text to speech. Regards... Joe Gabriele "Marc Rohloff [TeamB]" <"on request"> wrote in message news:l9eids1x5dc6.dlg@dlg.marcrohloff.com... > On Fri, 7 Apr 2006 20:50:21 -0400, Joe Gabriele wrote: > >> BufferDescription is the DirectX Sound structure into which you would >> load a >> WAV file in order to play it. The Format element of BufferDescription is >> the >> WaveFormatEx structure. I would like to replace it with a >> WaveFormatExtensible structure instead. > > Can you post the definition you're using or better yet a complete code > example. It might help if you post links to what you are trying to do. > > -- > Marc Rohloff [TeamB] > marc rohloff -at- myrealbox -dot- com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads