Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

maciejmakowski2003
Copy link
Collaborator

-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

Copy link
Member

@michalsek michalsek left a 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,
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(isPlaying) return
if (isPlaying) {
return
}

:)

}

fun stop() {
if(!isPlaying) return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!isPlaying) return
if (!isPlaying) {
return
}

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants