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

27
LINES

< > BotCompany Repo | #1026782 // AI Sounds

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1796K of libraries. Click here for Pure Java version (12083L/65K).

!7

// TODO: volume

concept Sound {
  S name, dataID;
}

cmodule AISounds > DynCRUD<Sound> {
  afterVisualize {
    addSelectionDependentButton("Play", rThread {
      playSound(selected());
    });
  }
  
  // API
  
  void playSound(Sound sound) {
    if (sound == null) ret;
    print("Playing sound: " + sound.name);
    playAudioFile(loadLibrary(sound.dataID));
  }
  
  void playSound(S soundName) {
    playSound(random(conceptsWhereCI Sound(name := soundName)));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026782
Snippet name: AI Sounds
Eternal ID of this version: #1026782/8
Text MD5: 9efdc6fa344468038f5cf6156267f956
Transpilation MD5: 59d4ec3db9f3dd2f494b6f0d164a6396
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-22 14:44:25
Source code size: 503 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 151 / 647
Version history: 7 change(s)
Referenced in: [show references]