sethbrasile/ember-audio
Tentang
An Ember addon that makes working with the Web Audio API super EZ.
Desain dan mediaPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliEmber-audio
This README describes the 1.1.0 beta candidate. For the version installed by ember install ember-audio, see the published package.
Installation
ember install ember-audio
Interactive Demo/Documentation
Ember Audio provides an audio service and various classes/mixins that make
working with the Web Audio API super EZ.
Ember Audio aims to simplify sampling, triggering, routing, scheduling, synthesizing, soundfonts, and working with audio in general.
EZ Web Audio brings Ember Audio’s sounds, tracks, and samplers to a standalone TypeScript library. It’s designed as a natural replacement for Ember Audio, including in existing Ember apps. Ember Audio remains maintained. A migration guide and a detailed comparison of the two libraries are planned.
Need your help!
Please give me feedback/suggestions if you have any. Pull requests and issues
are welcome. You can also contact me on the Ember community discord: @sethbrasile.
Using Ember Audio?
Please let me know if you're building something with Ember Audio! It's a fairly
large project, and I would love to know if it's working out for people! You can
contact me via @sethbrasile on the ember community discord, or via email.
Compatibility
The upgrade tests install 1.0.1 into an app, then install the candidate tarball into the same app. They cover Ember 2.18, 3.28, 4.12, 5.12, 6.12 and 7.4. The 7.4 app builds with Vite. You can set gain and pan immediately after creating a sound with either setting of Ember’s default-async-observers feature.
Existing apps with locked dependencies can keep their Node version. A classic Ember 3.8 app built and played audio on Node 6, 8, 10 and 12 after upgrading. On a fresh install below Node 20, Yarn 1 can reject newer transitive build dependencies on their engine check. The same limitation applies to 1.0.1. Its documented workaround is yarn add --dev ember-audio --ignore-engines. For development in this repository, use the Node version in .node-version.
Playback and loading changes since 1.0.1
- Creating an oscillator with
gain: 0starts it muted. Negative pan values move sound left. If you relied on the previous centered output, usechangePanTo(0). - Oscillator filters accept
qfor resonance. Live updates such asosc.update('highpass.q', 2)target the same filter parameter used at creation. - After awaiting
audio.load(urls).asBeatTrack(name), you can retrieve the track withaudio.getBeatTrack(name). If a sample fails to load, the call resolves toundefinedand you can retry. Removing a track while it loads keeps it out of the register. - Concurrent calls to
asFont(name)wait for the same decoded font. After a failed load, you can retry with the same name.
Upgrading from 1.0.0
Version 1.0.1 switched audio loads to window.fetch. Apps that import fetch from 'fetch' and relied on this addon to install ember-fetch should declare that dependency themselves. For tests, use a request mock that intercepts window.fetch. Pretender 2.0.0 let requests reach the network. Versions 2.1.0, 2.1.2 and 3.4.7 intercepted them.
Await the load before checking decoded audio. Ember’s settled() can finish earlier.
const sound = await audio.load('/audio/kick.wav').asSound('kick');
Run The Demo locally
ember serve- Visit http://localhost:4200/ember-audio/.
Roadmap
- Get up to date so it doesn't create issues with new ember apps. The current goal is keeping compatibility all the way back to Ember 3.28 but no issues or deprecations in Ember 4+ - Done
- Do some cleanup and testing and ensure compatibility, assess for breaking changes, then cut a new release.
- Switch to 100% JS classes, no ember "classic classes" - but I haven't decided on a strategy for the mixins yet. I like the composability of combining mixins to create new playable/connectable types. Take a look at how most of the classes are built, and take a look at MusicallyAwareOscillator to see what I mean. I am open to suggestions if you have an idea on how to maintain this composability without mixins. I have a feeling decorators could do something similar, but I've not authored one of those yet and I see similar warnings about them compared to mixins so I'm uncertain.
- Cut a 2.0 release (
.getapi will be broken for instance) - Move Ember Audio to Typescript - This might interfere with the mixin concept also. IIRC Typescript doesn't like mixins.. At least provide TS definitions.
- Extract most of the important code into a non-ember project and reference that as a dependency here.
Building yuidoc Documentation
ember ember-cli-yuidoc
For more information on using ember-cli, visit http://ember-cli.com/. [Longer description of how to use the addon in apps.]
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.
Jelajahi proyek terkait
Memuat…