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: first? iteration of the piano tutorial #240

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/audiodocs/docs/fundamentals/lets-make-some-noise.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,17 @@ import LetsMakeSomeNoiseSrc from '!!raw-loader!@site/src/examples/LetsMakeSomeNo
In web environment you can use `decodeAudioDataSource` directly on the asset url, without the need to download it first.

:::

## Summary

In this guide, we have learned how to create a simple audio player using `AudioContext` and `AudioBufferSourceNode` as well as how we can load audio data from a remote source. To sum up:

- `AudioContext` is the main object that controls the audio graph.
- `decodeAudioDataSource` method can be used to load audio data from a local audio source in form of `AudioBuffer`.
- `AudioBufferSourceNode` can be used to any `AudioBuffer`.
- In order to hear the sounds, we need to connect the source node to the destination node exposed by `AudioContext`.
- We can control the playback of the sound using `start` and `stop` methods of the `AudioBufferSourceNode` (And other source nodes which we show later).

## What's next?

In [the next section](/fundamentals/making-a-piano-keyboard) we will learn more about how the audio graph works, what are audio params and how we can use them to create a simple piano keyboard.
Loading
Loading