Skip to content

Clarification of files location #117

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Click on video to see example 💥
## Preparation
All audio place in specific platform folder

Andoid: `android/app/src/assets`
Andoid: `PROJECT_ROOT/android/app/src/assets`

iOS: `ios/App/App/sounds`
iOS: `PROJECT_ROOT/ios/App/App/sounds`

Web: `assets/sounds`
Web: `PROJECT_ROOT/public/assets/sounds`

## Installation

Expand All @@ -62,7 +62,7 @@ Sync native files
npx cap sync
```

On iOS, Android and Web, no further steps are needed.
On iOS, Android and Web, no further steps are needed by stricly following the files location then just use the filename as *assetPath*.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better but the whole line is untrue if you need to open the project in xcode to get it working


## Configuration

Expand Down Expand Up @@ -109,7 +109,7 @@ import {NativeAudio} from '@capacitor-community/native-audio'
*/
NativeAudio.preload({
assetId: "fire",
assetPath: "fire.mp3",
assetPath: "fire.mp3",// here it is meaning the file is located under PROJECT_ROOT/public/assets/sounds/
audioChannelNum: 1,
isUrl: false
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class Constant {
public static final String ERROR_AUDIO_ID_MISSING = "Audio Id is missing";
public static final String ERROR_AUDIO_ASSET_MISSING = "Audio Asset is missing";
public static final String ERROR_AUDIO_EXISTS = "Audio Asset already exists";
public static final String ERROR_ASSET_PATH_MISSING = "Asset Path is missing";
public static final String ERROR_ASSET_PATH_MISSING = "Asset Path is missing or audio file can't be find";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final String ERROR_ASSET_PATH_MISSING = "Asset Path is missing or audio file can't be find";
public static final String ERROR_ASSET_PATH_MISSING = "Asset Path is missing or audio file can't be found";

public static final String ERROR_ASSET_NOT_LOADED = "Asset is not loaded";

public static final String ASSET_ID = "assetId";
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Constant {
public static let Loop = "loop"

public static let ErrorAssetId = "Asset Id is missing"
public static let ErrorAssetPath = "Asset Path is missing"
public static let ErrorAssetPath = "Asset Path is missing or audio file can't be find"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static let ErrorAssetPath = "Asset Path is missing or audio file can't be find"
public static let ErrorAssetPath = "Asset Path is missing or audio file can't be found"

public static let ErrorAssetNotFound = "Asset is not loaded"
public static let ErrorAssetExists = "Audio Asset already exists"
}