|
Richard Andrew x64 wrote: Google this name, "Total Recorder".
They sell a library that lets you intercept the audio stream.
However, it doesn't work with Vista because Vista has a protected audio stream.
Thanks, I've had a look at Total Recorder, the latest version does work with vista athough it seems that all I can do with it is duplicate the audio stream as it is output rather than being able to actually reroute it. I might be wrong of course.
What I would really like to be able to do is capture the audio stream before it gets to the sound output device and then add my delay before sending it on again.
|
|
|
|
|
I have come accros another issue whist trying to use directx to acheive my goal. I thought I would start by attempting to identify what the sound output device was identified as so I wrote the following to hopefuly display all my sound devices.
DevicesCollection devList = new DevicesCollection();
foreach (DeviceInformation device in devList)
{
Console.WriteLine(device.ToString());
}
Unfortunately running this code reulted in the following error.
LoaderLock was Detected
DLL 'C:\Windows\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll'
is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a
DllMain or image initialization function since doing so can cause the application to hang.
I've never come accross this before and have absolutely no idea how to resolve it. I'm a bit of a beginner having completed only 1 year of a computer science degree course so far and errors like this just tend to floor me.
|
|
|
|
|
|
hi,
i need to convert an ascii byte array to string.
in the byte [] could be 0 value that marks the end of the string.
i tried to do it like that :
byte[] test = { 0x41, 0x42, 0 };
string mystr = ASCIIEncoding.ASCII.GetString(test);
but the result is - "AB\0"
can i do it otherway to get just "AB" ?
thanks,
Samy
|
|
|
|
|
mystr.TrimEnd('\0');
Eslam Afifi
|
|
|
|
|
tried but doesn't work - still is the same. seems like the trim has no effect
|
|
|
|
|
mystr = mystr.TrimEnd('\0');
|
|
|
|
|
Of course it won't change the string it will return a new one. Strings are immutable. Sorry if the answer wasn't clear enoguh. PIEBALDconsult provided a full answer, and so did many others.
Eslam Afifi
|
|
|
|
|
This works (I tested it):
byte[] test = { 0x41, 0x42, 0 };
string mystr = ASCIIEncoding.ASCII.GetString(test);
if (mystr.EndsWith("\0"))
{
mystr = mystr.Substring(0, mystr.Length - 1);
}
Natza Mitzi
|
|
|
|
|
If you trying to convert a byte array to string, stopping on the first null, then try:
byte[] ab = { 0x41, 0x42, 0x43, 0, 0x44, 0x45 };
StringBuilder sb = new StringBuilder(ab.Length);
foreach (byte b in ab)
{
if (b == 0)
{
break;
}
sb.Append((char) b);
}
string s = sb.ToString();
I don't know of a built-in way to do it (though I have been wrong before).
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I thought Marshal.PtrToStringAnsi did that.. You have to give it a pointer though, so you need unsafe code.
|
|
|
|
|
I told you I could be wrong! Not too happy recommending unsafe code for this task, though - I prefer to keep it for when I need it (like converting strings to secure strings)
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
That just sounds ironic...needing "unsafe" code to create "secure" strings
Dybs
|
|
|
|
|
I know what you mean!
The problem is that managed (or safe) strings are duplicated, copied and may (or may not) be deleted - the unmanaged (or unsafe) stuff is more under your control, and thus "safer". I blame Microsoft for not introducing a "Secure" keyword for variables...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I probably wouldn't use it either (seems a bit like a canon to kill an ant, right?) but it exists
|
|
|
|
|
Hi,
GetString converts all the bytes from ASCII to Unicode, and 0 is a valid character, it is ASCII NULL.
If you know there is a NULL, then use ASCIIEncoding.ASCII.GetString(test, 0, test.Length-1);
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
string mystr = new string(Array.ConvertAll(test, x => (char) x));
xacc.ideIronScheme - 1.0 beta 3 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
|
IMO that is too much of a code to read. Are you trying to merge two files?
|
|
|
|
|
|
It would be very unusual for anybody to share an Email address with people they don't know.
You would help people to read your code if you put it between <pre></pre> tags, and format it properly, with indents and so on. Also only post relevant code, there is far too much in your question.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
As I said, format your code, cut out anything not directly related to the problem and then more people will be likely to read it and offer suggestions.
At the moment I am not prepared to strain my eyes and brain, trying to read your code. Therefore I am unable to help resolve your problem.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Thanks for your proposal. But I dont think it would be easier to understand for other people if I shorten it out. But I have another suggestion. If you can compile the code and then I can give you the example of security.txt and position.txt and then you may see the result and the problem itself.
Any thoughts?
|
|
|
|
|
I can't speak for Henry, but I would not compile and run source code from someone I didn't know well and hadn't examined thoughly - any more than I would run an EXE file I "just found" on a website.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|