-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "analog-radio-example" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Dart | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Analyze project source | ||
run: dart analyze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,48 @@ | ||
# Analog radio emulator | ||
# :radio: Analog radio emulator | ||
|
||
[![pub package](https://img.shields.io/pub/v/analog_radio.svg)](https://pub.dev/packages/analog_radio) | ||
[![Web Demo](https://img.shields.io/badge/Radio-Demo-FFB300.svg)](https://analog-radio-example.web.app/) | ||
|
||
## About | ||
|
||
This package adds distortion to the online audio stream, so it becomes like a radio receiver. | ||
|
||
You can change the signal level so that it can be very weak and there will be a lot of interference. | ||
|
||
The AudioContext Api is used. Therefore, it works only in the browser. | ||
|
||
[Example](https://analog-radio-example.web.app/) | ||
|
||
## Install | ||
|
||
```sh | ||
dart pub add analog_radio | ||
``` | ||
|
||
## Using | ||
|
||
```dart | ||
// Creating radio instance. Will be created audiocontext with audio processing. | ||
var radio = AnalogRadio(); | ||
// Start playing sound. You will be able to hear the radio noise | ||
radio.turnOn(); | ||
// You set up the "radio receiver" for a specific audio stream with a signal level of 0.9. | ||
// You will hear an audio stream with a slight addition of noise and distortion. | ||
radio.tune('https://vip2.fastcast4u.com/proxy/classicrockdoug?mp=/1', 0.9); | ||
// With a signal level of 0.3, the audio stream will be heard very poorly with a high level of interference | ||
radio.tune('https://vip2.fastcast4u.com/proxy/classicrockdoug?mp=/1', 0.3); | ||
// Stop playing sound | ||
radio.turnOff(); | ||
``` | ||
|
||
## Developing | ||
|
||
```sh | ||
dart pub global activate webdev | ||
dart pub get | ||
webdev serve | ||
webdev serve --release | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"hosting": { | ||
"public": "build", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,7 @@ abstract class AnalogRadio { | |
|
||
/// The radio is on | ||
bool get running; | ||
|
||
/// Dispose | ||
void dispose(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters