likelian / Repeator

An audio plugin to add repeated noise or other sounds.
2 stars 0 forks source link

load file from menu selection #19

Closed likelian closed 2 years ago

likelian commented 2 years ago

Click "more..." and a pop-up window let users to load an audio file.

likelian commented 2 years ago

Juce Tutorial 36- Opening Audio Files using the File Chooser Class https://www.youtube.com/watch?v=eB6S8iWvx2k

Tutorial: Build an audio player https://docs.juce.com/master/tutorial_playing_sound_files.html

likelian commented 2 years ago

Those seem to be involving building a streaming player of local audio files, a bit different from loading audio into a plugin.

likelian commented 2 years ago

Build a Sampler VST Plug-in with JUCE Part 1 - Loading and Playing https://www.youtube.com/watch?v=F-EkwKFftPY#action=share

likelian commented 2 years ago

Build a Sampler VST Plug-in with JUCE Part 1 - Loading and Playing https://www.youtube.com/watch?v=F-EkwKFftPY#action=share

Synthesiser Class - Base class for playing notes SampleSound Class - represents sampled audio clip SamplerVoice Class - “number of voices” the sampler can play

File Loading FileChooser Class -Loads browser dialog to choose file File Class - File

File -> playing audio

AudioFormatManager Class - registers basic audio formats AudioFormatReader Class - reads samples from audio stream

likelian commented 2 years ago

Build a Sampler VST Plug-in with JUCE Part 1 - Loading and Playing https://www.youtube.com/watch?v=F-EkwKFftPY#action=share

The provided method in the tutorial doesn't work (at least easily) with the current version. Instead, use the demo code in the documentation.

More about this issue https://forum.juce.com/t/solved-juce-filechooser-has-no-member-browseforfiletoopen/47793/5

likelian commented 2 years ago

prepareToPlay() called whenever block length is changed (at least in Logic Pro). We can Initial the audioBuffer inside prepareToPlay().

likelian commented 2 years ago

Is sampling rate conversion a concern?

likelian commented 2 years ago

https://forum.juce.com/t/using-audioformatmanager-and-audioformatreader-to-load-audio-files-in-a-preallocated-buffer/28659/6

likelian commented 2 years ago

able to select and load wav files now. Next: test on other formats, especially mp3.

likelian commented 2 years ago
 registerFormat (new WavAudioFormat(), true);
    registerFormat (new AiffAudioFormat(), false);

   #if JUCE_USE_FLAC
    registerFormat (new FlacAudioFormat(), false);
   #endif

   #if JUCE_USE_OGGVORBIS
    registerFormat (new OggVorbisAudioFormat(), false);
   #endif

   #if JUCE_MAC || JUCE_IOS
    registerFormat (new CoreAudioFormat(), false);
   #endif

   #if JUCE_USE_MP3AUDIOFORMAT
    registerFormat (new MP3AudioFormat(), false);
   #endif

   #if JUCE_USE_WINDOWS_MEDIA_FORMAT
    registerFormat (new WindowsMediaAudioFormat(), false);
   #endif
likelian commented 2 years ago

wma doesn't load on Mac, but perhaps it will load on Windows

likelian commented 2 years ago

tested audio formats (just loading): .aac;;.aiff;;.flac;;.m4a;;.mp3;;.ogg;;*.wav;;