Skip to content
项目

关于

An Ember addon that makes working with the Web Audio API super EZ.

设计与媒体

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Ember-audio

Github CI Workflow codecov Code Climate Issue Count Ember Observer Score

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: 0 starts it muted. Negative pan values move sound left. If you relied on the previous centered output, use changePanTo(0).
  • Oscillator filters accept q for resonance. Live updates such as osc.update('highpass.q', 2) target the same filter parameter used at creation.
  • After awaiting audio.load(urls).asBeatTrack(name), you can retrieve the track with audio.getBeatTrack(name). If a sample fails to load, the call resolves to undefined and 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

Roadmap

  1. 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
  2. Do some cleanup and testing and ensure compatibility, assess for breaking changes, then cut a new release.
  3. 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.
  4. Cut a 2.0 release (.get api will be broken for instance)
  5. Move Ember Audio to Typescript - This might interfere with the mixin concept also. IIRC Typescript doesn't like mixins.. At least provide TS definitions.
  6. 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.

探索相关项目

加载中…