Giter Site home page Giter Site logo

audio's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

audio's Issues

Play Audio with RStudio Server on Linux Centos

I know about the audio package and require PortAudio library.
http://www.rforge.net/audio/index.html

Well, then I browsed over the How to access SoundCloud from the command line in Linux and
install it. https://github.com/grobie/soundcloud2000

$ sudo yum install portaudio-devel mpg123-devel
$ sudo gem install curses soundcloud2000

But now unable play the audio... May I know if there is anything missing out?

> library('audio')
> audio.drivers()
[1] name        description current    
<0 rows> (or 0-length row.names)
> play(sin(1:10000/20)) # play a short sound of a fixed frequency
- Error in play.default(sin(1:10000/20)) : no audio drivers are available

Package needs to link to -framework CoreAudio on MacOS

If we link without -undefined flag we see a linking error. This is a problem when cross compiling, for example see this build log: https://github.com/r-universe/s-u/actions/runs/7493616675/job/20399774796

checking for aarch64-apple-darwin20-gcc... clang -arch arm64
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang -arch arm64 accepts -g... yes
checking for clang -arch arm64 option to enable C11 features... none needed
checking AudioUnits... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for library containing dlsym... none required
checking for portaudio.h... no
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
using C compiler: ‘Apple clang version 13.0.0 (clang-1300.0.29.30)’
using SDK: ‘MacOSX12.1.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DHAS_CONFIG_H=1 -I/opt/R/arm64/include  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c au.c -o au.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DHAS_CONFIG_H=1 -I/opt/R/arm64/include  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c driver.c -o driver.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DHAS_CONFIG_H=1 -I/opt/R/arm64/include  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c file.c -o file.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DHAS_CONFIG_H=1 -I/opt/R/arm64/include  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c pa.c -o pa.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DHAS_CONFIG_H=1 -I/opt/R/arm64/include  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c reg.c -o reg.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DHAS_CONFIG_H=1 -I/opt/R/arm64/include  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c wmm.c -o wmm.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -L/opt/R-4.3-arm64/lib -L/opt/R/arm64/lib -o audio.so au.o driver.o file.o pa.o reg.o wmm.o -framework AudioUnit -framework CoreServices -L/opt/R-4.3-arm64/lib -lR -Wl,-framework -Wl,CoreFoundation
Undefined symbols for architecture arm64:
  "_AudioDeviceCreateIOProcID", referenced from:
      _audiounits_create_recorder in au.o
  "_AudioDeviceDestroyIOProcID", referenced from:
      _audiounits_close in au.o
      _audiounits_dispose in au.o
  "_AudioDeviceStart", referenced from:
      _audiounits_start in au.o
  "_AudioDeviceStop", referenced from:
      _audiounits_pause in au.o
      _inputRenderProc in au.o
  "_AudioObjectGetPropertyData", referenced from:
      _audiounits_create_recorder in au.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [audio.so] Error 1

For example here: https://github.com/r-universe/s-u/actions/runs/7493616675/job/20399774796

Choppy sound when playing audio on Ubuntu Linux

I have downloaded and installed the Portaudio library, and then installed this audio package from CRAN.

The playback is not smooth (see the attached sound recording of play(sin(1:1000000/20))). Is there anything I can do?
2016-08-31-09:35:55.ogg.zip

Session info -----------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.1 (2016-06-21)
 system   x86_64, linux-gnu           
 ui       RStudio (0.99.1294)         
 language en_US                       
 collate  en_US.UTF-8                 
 tz       <NA>                        
 date     2016-08-31                  

Packages ---------------------------------------------------------------------------------------------------------------------
 package  * version date       source        
 audio    * 0.1-5   2013-12-23 CRAN (R 3.3.1)
 devtools   1.12.0  2016-06-24 CRAN (R 3.3.1)
 digest     0.6.10  2016-08-02 CRAN (R 3.3.1)
 memoise    1.0.0   2016-01-29 CRAN (R 3.3.0)
 withr      1.0.2   2016-06-20 CRAN (R 3.3.1)

Inability to take audio focus

On one of my Windows machines, HP Pavilion HPE h8z Series with integrated audio running Windows 8.1, the audio package does not play if something else has the audio focus. So for instance, if I am listening to music on Google Play through my Chrome browser or if I am listening to music on iTunes for Windows or on Pot Player by Daum then I cannot hear the audio output.

play(sin(1:10000/20)) is is not heard.

If those audio applications are off then I can hear it. Interestingly enough, I was playing music in Google Play and I reduced the volume on the webpage to zero, and then issued the play command in R. I heard it. But if the volume in Google Play was audible in any way, no matter how softly, then I could not hear what R played.

Is this the appropriate place to seek troubleshooting support? I do not know if it is a software bug or an idiosyncratic problem in my computer. After all, it does not happen on my other computer at work.

ASIO drivers and output channel selection?

Hello,

thank you very much for the 'audio' package. I worked in the past with 'Octave' and the 'Playrec' package (https://github.com/PlayrecForMatlab). Can I do something similar in R with the 'audio' package?

I have two concrete questions regarding the available audio drivers and the output channel selection for audio playback.

  1. I only find the package-built-in 'wmm' drivers (see below)
library(audio)
#> Warning: package 'audio' was built under R version 3.5.3
audio.drivers()
#>   name                     description current
#> 1  wmm Windows MultiMedia audio driver    TRUE

Is there a way I can access ASIO drivers? Playrec in Octave finds the 'ASIO4ALL v2' audio drivers, so they exist, I just can not find them in R with the 'audio' package.

  1. I know, that I can do audio playback in R with the 'audio' package using the 'play' function. Is there a way to specify a certain output channel? I work with a RME Fireface UC sound card with multiple output channels. I looked in the 'play' function documentation, but I did not find the possibility to select an output channel. Maybe it is hidden under (?):

... optional arguments passed to the method specific to the object being played

Thank you very much.

Best regards and stay healthy!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.