≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Error GetPlayPosition
Posted by:
(you are not logged in)
Enter the missing letter in: "Inte?national"
(you are not logged in)
Text:
[quote][b]sascha[/b] wrote: HI thanks I have also a little problem to understand the type of getSampleData(). Is it a ik_u8 or ik_s16? The problem is getSampleDataSize() return the number of bytes independend of type, for this reaon it should be always a ik_u8. But if it is right why return the function a void*. I try the following to get the left channel, but it is crashing: [code] ik_u8 * data = ik_u8*)m_soundSource->getSampleData(); if ( data == NULL ) return 0; int fs = m_streamFormat.getFrameSize(); int nn = n*fs; int cc = 0; for ( int i = 0 ; i < nn; i+=fs ) { if ( ESF_U8 == m_streamFormat.SampleFormat ) // one unsigned byte (0;255) { ik_u8 d = data[i]; x[cc] = (double) d; y[cc] = 0.0; } else // 16 bit, signed (-32k;32k) little endian { short res = (data[i+1]); res = (data[i] << 8); x[cc] = (double) res; y[cc] = 0.0; } cc++; } return cc; [/code] Can you please make a short example to support me. Many hanks Sascha[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact