-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/android/oscillator #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpick, besides that looks promising 🙌
44100, | ||
AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT) | ||
this.audioTrack = AudioTrack( | ||
AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_MONO, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would to be good to move 44100
to be a constant
var phaseChange: Double | ||
|
||
while(isPlaying) { | ||
phaseChange = 2 * Math.PI * (frequency + detune) / 44100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and use it also here :)
external fun initHybrid(l: Long): HybridData? | ||
|
||
fun start() { | ||
if(isPlaying) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(isPlaying) return | |
if (isPlaying) { | |
return | |
} |
:)
} | ||
|
||
fun stop() { | ||
if(!isPlaying) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(!isPlaying) return | |
if (!isPlaying) { | |
return | |
} |
:)
…inject into js runtime
-Implemented oscillator class in Kotlin containing whole sound generating logic and AudioContex native module which provides method for creating oscillator instance on JS side(
createOscillator( )
)-Implemented c++ HybridClass for this oscillator
-Implemented jsi HostObject for this oscillator and injected it into js runtime
Issue: #16