0
0

Hi to all,
I already posted this topic but in a incorrect english :(
I need to store in a memory buffer the audio flow (what I’m listening), but I don’t have any idea of how to do it.
I would store the raw data.
Can I have a help?
Thank in advance .
Franco

  • You must to post comments
0
0

[quote="ronan.fmod":7ytievi3]I am not in the position to tell you what is best for you.
I do not know what are your application needs and I do not want to.
You will have to try, sometimes fail, read documentation and make decisions by yourself.
This is how programming goes[/quote:7ytievi3]

Thanx again

  • You must to post comments
0
0

I did understand what you meant

the answer I gave you is still valid:

[quote:3h9noasn]consider creating your own output plugin
Or create a DSP (register a callback of your own on the master channel)[/quote:3h9noasn]

You may have a look at the DSP examples

  • You must to post comments
0
0

output_mp3 is in /plugin_dev folder btw :)

  • You must to post comments
0
0

Hi Ronan,
thank you for your reply.

[quote="ronan.fmod":2durttep]I did understand what you meant

the answer I gave you is still valid:

[quote:2durttep]consider creating your own output plugin
Or create a DSP (register a callback of your own on the master channel)[/quote:2durttep]

You may have a look at the DSP examples[/quote:2durttep]

I have no experience in writing plugin. And can you give me a guide line?
Regards,
Franco

  • You must to post comments
0
0

[quote="brett":hhj2zifu]output_mp3 is in /plugin_dev folder btw :)[/quote:hhj2zifu]

thank you god.

  • You must to post comments
0
0

There is already a big part of what you need in the documentation examples.

Check the dsp_custom and output_mp3 plugins

  • You must to post comments
0
0

[quote="franco.amato":2gu0mv1w][quote="brett":2gu0mv1w]output_mp3 is in /plugin_dev folder btw :)[/quote:2gu0mv1w]

thank you god.[/quote:2gu0mv1w]

I analized the output_mp3 plugin code but I still don’t understand how to store in memory stream/buffer the sound that the system object of my application play. I also analyzed the recording and recordtodisk examples but nothing.
Can I have a help with a guide line and/or some code? Or I can not advance with my work.

Regards,
Franco

  • You must to post comments
0
0

Dear Ronan,

[quote="ronan.fmod":14xwz2c6]There is already a big part of what you need in the documentation examples.

Check the dsp_custom and output_mp3 plugins[/quote:14xwz2c6]

I’ll check immediately thanx.
Cheers,
Franco

  • You must to post comments
0
0

Hi,

I tried to solve similar problem (I think). To get the access to the data one needs something like (taken from recordtodisk c# example):

[code:5q2cx2n9]
if (recordpos != lastrecordpos)
{
IntPtr ptr1 = IntPtr.Zero, ptr2 = IntPtr.Zero;
int blocklength;
uint len1 = 0, len2 = 0;

                blocklength = (int)recordpos - (int)lastrecordpos;
                if (blocklength < 0)
                {
                    blocklength += (int)soundlength;
                }

                /*
                    Lock the sound to get access to the raw data.
                */
                sound.@lock(lastrecordpos * 4, (uint)blocklength * 4, ref ptr1, ref ptr2, ref len1, ref len2); /* *4 = stereo 16bit.  1 sample = 4 bytes. */

                /*
                    Write it to disk.
                */
                if (ptr1 != IntPtr.Zero && len1 > 0)
                {
                    byte[] buf = new byte[len1];

                    Marshal.Copy(ptr1, buf, 0, (int)len1);

                    datalength += (int)len1;

                    fs.Write(buf, 0, (int)len1);

                }
                if (ptr2 != IntPtr.Zero && len2 > 0)
                {
                    byte[] buf = new byte[len2];

                    Marshal.Copy(ptr2, buf, 0, (int)len2);

                    datalength += (int)len2;

                    fs.Write(buf, 0, (int)len2);
                }

                /*
                    Unlock the sound to allow FMOD to use it again.
                */
                sound.unlock(ptr1, ptr1, len1, len2);
            }

[/code:5q2cx2n9]

The point is that one needs to lock the buffer. Do not ask me [b:5q2cx2n9]why [/b:5q2cx2n9]there is a need for two pieces of data (ptr1, ptr2), this is what I am trying to figure out myself. Started two threads related to "why" issue:

http://52.88.2.202/forum/viewtopic.php?t=10565
http://52.88.2.202/forum/viewtopic.php?t=10569

Best
ZoranK

p.s. Last line could be a bug:

[code:5q2cx2n9]sound.unlock(ptr1, ptr1, len1, len2);[/code:5q2cx2n9]

uses ptr1,ptr1,… instead of ptr1,ptr2,… i am still a newbie so do not dare to bet my head on it.

  • You must to post comments
0
0

Dear Ronan,

[quote="ronan.fmod":13req7bc]There is already a big part of what you need in the documentation examples.

Check the dsp_custom and output_mp3 plugins[/quote:13req7bc]

Where can I find the output_mp3 plugin? I try in my examples folder but I can not find it.
Regards,
Franco

  • You must to post comments
0
0

why are you looking into the folders ? It’s one of the projects in the examples.sln Visual Studio solution file…

if you do not have visual studio then find it in the subfolder plugin_dev

  • You must to post comments
0
0

[quote="ronan.fmod":3uofdv4y]why are you looking into the folders ? It’s one of the projects in the examples.sln Visual Studio solution file…

if you do not have visual studio then find it in the subfolder plugin_dev[/quote:3uofdv4y]

Because I’m working under Linux.
The example "recordtodisk" can also be used for my purpose?
I only need the raw data.
Regards,
Frank

  • You must to post comments
0
0

Sorry, I don’t know about linux, you must look into the documentation

  • You must to post comments
0
0

Hi Ronan,

[quote="ronan.fmod":tvtuxzo1]Sorry, I don’t know about linux, you must look into the documentation[/quote:tvtuxzo1]

What I mean is: can I take the "recordtodisk" code as example to extract the raw audio data and add them to my video instead of the output_mp3 or custom_dsp?
Regards,
Franco

  • You must to post comments
0
0

I am not in the position to tell you what is best for you.
I do not know what are your application needs and I do not want to.
You will have to try, sometimes fail, read documentation and make decisions by yourself.
This is how programming goes

  • You must to post comments
Showing 15 results
Your Answer

Please first to submit.