Comments (2)
Thanks for the response.
I've tried increasing the sampleRate
to 96000
exactly the example you provided. But it still seems a bit different, A frequency of 200
in Zentone, sounds a bit high-pitched, at least from what I hear. I've tried playing the same frequency in Tonejs, but they all sound like the one on YouTube, I don't think it has something to do with audio quality.
Tonejs, YouTube, and others all sound similar, 200Hz is a bit lower-pitched, similar to this: https://www.rapidtables.com/tools/tone-generator.html?f=200
I've tested ZenTone in the emulator and in the actual device but 200
Hz still sounds high-pitched compared to others. I'm not sure if I'm missing something, I know ZenTone doesn't do any magic, and it just plays a sine wave byte data which is why it confuses me how it doesn't sound similar.
Would appreciate any help in shedding light on where could be the issue.
Thanks
from zentone.
Initial thought is that you are comparing this wrong. Youtube plays high def audio at sampling rate of 44K, 48k, 96k and so on. This just means that the audio has more rich info encoded, thus being able to emit more specific frequency sound. When you generate this via the library code then ZenTone generates audio at a default sampling rate of 44k.
However you can pass a different sampling rate into the constructor, when initializing ZenTone
val zentone = ZoneTone(sampleRate = 96000, encoding = AudioFormat.ENCODING_PCM_32BIT, channelMask = AudioFormat.CHANNEL_OUT_STEREO)
Similarly changing the encoding also has an effect.
The parameters that one uses effects how your audio sounds. Under the hood ZenTone doesn't do any magic, but generate byte data that is played over your audio output i.e speakers
If this does not fix your problem, then I will try to investigate this further and pin down how to achieve the similar sounding audio.
from zentone.
Related Issues (11)
- Be able to generate tones of lengths other than seconds HOT 3
- Remove Duration HOT 1
- Can't generate two frequency at the same HOT 1
- Big duration makes app crash because OOM HOT 2
- stop() doesn't stop really HOT 3
- Duration in ms? HOT 3
- Generate tone but play in stereo channels? L/R HOT 1
- Migrate to Maven Central HOT 1
- Allow custom WaveGenerators
- Add more WaveGenerators
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zentone.