Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1018676 // dm_playWAV

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2885L/19K).

svoid dm_playWAV(File wavFile) {
  // TODO: optimize
  short[] audio = decodeWAVToStereoSamples(wavFile);
    
  audio = convertSampleRate_stereoShortArray_simple(audio, wavSampleRate(wavFile), dm_audioOutputSampleRate());
  
  // Make sound source & add to audio output module
  final Var<VF1<double[]>> source = new Var;
  source.set(stereoSamplesIterator_single(audio, r { dm_removeSoundSource(source!) }));
  dm_addSoundSource(source!);
}

Author comment

Began life as a copy of #1018673

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1018676
Snippet name: dm_playWAV
Eternal ID of this version: #1018676/10
Text MD5: 64e8b9076775e42c11c14c22b375caab
Transpilation MD5: 704b055c71b5061e66964b811aadc729
Author: stefan
Category: javax / stefan's os / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-07 00:32:03
Source code size: 452 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 504 / 581
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1026946 - dm_addShortArraySoundSource