HVScrollView icon indicating copy to clipboard operation
HVScrollView copied to clipboard

博主可以去看看 “饿了么”的文章

Open wwdc14yh opened this issue 7 years ago • 1 comments

在此

我也即将模仿饿了么商家界面,根据饿了么的文章模仿到了一半,卡在Dynamics那里 ,我个人感觉饿了么这一套方案还是比较简单的

wwdc14yh avatar Dec 05 '17 07:12 wwdc14yh

Hi Marc,

Thanks for getting in touch. I will perhaps update this for the next version, or maybe with some example code. But for now, here is what I would do at step 4 to fill a buffer with a sine wave... (i've added some extra variables for clarity):

int numChannels = 2;
int numSamplesPerChannel = 100000;
float sampleRate = 44100.f;
float frequency = 440;

for (int i = 0; i < numSamplesPerChannel; i++)
{
        float sample = sinf (2. * M_PI * ((float) i / sampleRate) * frequency) ;
        
        for (int channel = 0; channel < numChannels; channel++)
             buffer[channel][i] = sample * 0.5;
}

I haven't tested this - just wrote it here, but it should work. Hope this helps.

Adam

adamstark avatar Mar 24 '18 23:03 adamstark

Thank you so much for your quick response. This worked.

ScienceMarc avatar Mar 25 '18 10:03 ScienceMarc

I've now added this to the main documentation in the new version

adamstark avatar Oct 27 '18 23:10 adamstark