Skip to content

Commit

Permalink
add mimetype support
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian-Robert Stöter committed May 19, 2019
1 parent b8b72ef commit 1cfda53
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# open-unmix-demo

Standalone Source Separation Demo Player
Standalone Source Separation Demo Player that loads pre-processed multitrack audio files.

## Project setup
```
Expand All @@ -16,3 +16,30 @@ npm run electron:serve
```
npm run electron:build
```

## Example config file

Lets assume we a folder with subfolders for each audio tracks, separated into different sources:

```
tracks/track_1/vocals.m4a
tracks/track_1/bass.m4a
tracks/track_1/drums.m4a
tracks/track_1/other.m4a
...
```

Specifying a `config.json` file like following would be sufficient to load the files into the demo player. Note that `audiopath` is a relative path with respect to the path of the config file.

```json
{
"title": "Open-Unmix Demo",
"audiopath": "tracks",
"tagline": "my great separation method",
"tracks": [
{ "path": "track_1", "name": "Artist - Title"},
],
"targets": ["bass", "drums", "other", "vocals"],
"extension": [".m4a"], "mimetype": "audio/mp4"
}
```
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ export default {
'customClass': target,
'solo': false,
'mute': false,
'type': this.config.mimetype,
'file': path.join(
audio_root,
this.selectedTrack, target + this.config.ext
this.selectedTrack, target + this.config.extension
)
}
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Player.prototype.loadTargets = function(trackurls) {
var tracksToLoad = []
for (let track of trackurls) {
var buffer = fs.readFileSync(track.file)
var blob = new Blob([buffer]);
var blob = new Blob([buffer], { type: track.type });
tracksToLoad.push(
{
"src": blob,
Expand All @@ -44,7 +44,7 @@ Player.prototype.loadTargets = function(trackurls) {

Player.prototype.addTrack = function(track) {
var buffer = fs.readFileSync(track.file)
var blob = new Blob([buffer]);
var blob = new Blob([buffer], { type: track.type });

this.playlist.load([
{
Expand Down

0 comments on commit 1cfda53

Please sign in to comment.