Skip to content

Commit db5a79a

Browse files
committed
feat: first tutorial and full setup
1 parent 68545b6 commit db5a79a

65 files changed

Lines changed: 8482 additions & 6303 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/common-app/src/components/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import React, { useState } from 'react';
22
import { ScrollView } from 'react-native-gesture-handler';
33
import { Modal, View, Text, Pressable, StyleSheet } from 'react-native';
44

packages/audiodocs/.eslintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"parser": "@babel/eslint-parser",
3+
"parserOptions": {
4+
"babelOptions": {
5+
"presets": ["@babel/preset-react"]
6+
}
7+
}
8+
}

packages/audiodocs/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

packages/audiodocs/docs/tutorial-extras/_category_.json renamed to packages/audiodocs/docs/fundamentals/_category_.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"label": "Tutorial - Extras",
3-
"position": 3,
2+
"label": "Fundamentals",
3+
"position": 1,
44
"link": {
55
"type": "generated-index"
66
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
slug: /
3+
sidebar_position: 1
4+
---
5+
6+
import Tabs from '@theme/Tabs';
7+
import TabItem from '@theme/TabItem';
8+
9+
# Getting started
10+
11+
The goal of _Fundamentals_ is to guide You through setup proces of Audio API as well as show base concepts standing behind audio programming using web audio framework to give you the confidence to explore more advanced use cases on your own. This section is packed with interactive examples, code snippets and explanations. Are you ready? Let's make some noise!
12+
13+
## What is React Native Audio API?
14+
15+
React Native Audio API is a powerful high-performant and low-level audio library built by [Software Mansion](https://swmansion.com/).
16+
RN Audio API is fully compatible\* with [Web Audio specification](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API), making it easy to write audio-intensive applications for iOS, Android and Web with just one codebase.
17+
18+
## Installation
19+
20+
It takes only a few steps to add audio api to Your project:
21+
22+
### Install the package
23+
24+
Install `react-native-audio-api` package from npm:
25+
26+
<Tabs groupId="package-managers">
27+
<TabItem value="expo" label="EXPO" default>
28+
29+
npx expo install react-native-audio-api
30+
31+
</TabItem>
32+
<TabItem value="npm" label="NPM">
33+
34+
npm install react-native-audio-api
35+
36+
</TabItem>
37+
<TabItem value="yarn" label="YARN">
38+
39+
yarn add react-native-audio-api
40+
41+
</TabItem>
42+
</Tabs>
43+
44+
### Expo development build
45+
46+
When using an [Expo development build](https://docs.expo.dev/develop/development-builds/introduction/), run prebuild to update the native code in the `ios` and `android` directories.
47+
48+
```bash
49+
npx expo prebuild
50+
```
51+
52+
### Platform specific setup
53+
54+
#### Android
55+
56+
No additional steps are necessary.
57+
58+
#### iOS
59+
60+
While developing for iOS, make sure to install [pods](https://cocoapods.org) first before running the app:
61+
62+
```bash
63+
cd ios && pod install && cd ..
64+
```
65+
66+
#### Web
67+
68+
No additional steps are necessary.
69+
70+
:::caution
71+
72+
`react-native-audio-api` on web, exposes browser built-in Web Audio API, but for compatibility between platforms, its limits available interfaces to APIs that are implemented on iOS and Android.
73+
74+
:::
75+
76+
### Clear Metro bundler cache (recommended)
77+
78+
<Tabs groupId="package-managers">
79+
<TabItem value="expo" label="EXPO" default>
80+
81+
npx expo start -c
82+
83+
</TabItem>
84+
<TabItem value="npm" label="NPM">
85+
86+
npm start -- --reset-cache
87+
88+
</TabItem>
89+
<TabItem value="yarn" label="YARN">
90+
91+
yarn start --reset-cache
92+
93+
</TabItem>
94+
</Tabs>
95+
96+
## What's next?
97+
98+
In [the next section](/fundamentals/lets-make-some-noise), we will learn how to prepare audio api and how to play some sound!.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Let's make some noise!
6+
7+
In this section, we will guide you through the basic concepts of Audio API. We're going to use core audio components such as `AudioContext` and `AudioBufferSourceNode` to simply play sound from a file, which will help you develop a basic understanding of the library.
8+
9+
## Using audio context
10+
11+
Let's start by bootstrapping a simple application with a play button and creating our first instance of `AudioContext` object.
12+
13+
```jsx
14+
import { AudioContext } from 'react-native-audio-api';
15+
16+
export default function App() {
17+
const handlePlay = () => {
18+
const audioContext = new AudioContext();
19+
};
20+
21+
return (
22+
<Pressable onPress={handlePlay}>
23+
<Text>Play sound!</text>
24+
</Pressable>
25+
)
26+
}
27+
```
28+
29+
`AudioContext` is object that controls both the creation of the nodes, as well as execution of the audio processing, or decoding. In simple words it is our entry to the audio processing world!
30+
31+
32+
##

packages/audiodocs/docs/index.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

packages/audiodocs/docs/tutorial-basics/_category_.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/audiodocs/docs/tutorial-basics/congratulations.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/audiodocs/docs/tutorial-basics/create-a-blog-post.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)