일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Java
- Mac
- PANDAS
- 파이썬
- Excel
- PostgreSQL
- GIT
- Github
- list
- gas
- Tkinter
- string
- matplotlib
- numpy
- PySpark
- Kotlin
- math
- Redshift
- array
- Python
- Google Excel
- Google Spreadsheet
- dataframe
- google apps script
- Apache
- django
- SQL
- hive
- c#
- Today
- Total
목록wav (2)
달나라 노트
SoundPlayer는 .wav 파일을 재생할 수 있도록 해줍니다. SoundPlayer는 System.Media.SoundPlayer 위치에 존재합니다. 이번 예시에서는 이미 .wav 파일을 아래 경로에 두었습니다. C:\Users\Public\sample.wav using System; class MyProgram { public static void Main() { System.Media.SoundPlayer player = new System.Media.SoundPlayer("C:\\Users\\Public\\sample.wav"); player.PlaySync(); } } 위 코드를 실행하면 sample.wav 파일의 소리가 들립니다. SoundPlayer class는 System.Media 하..
subprocess library를 이용해 Python에서 음악 파일을 재생할 수 있습니다. (본 예시는 Mac OS에서 실행되었습니다.) import subprocess subprocess.call(['afplay', 'music/test.mp3']) .위 예시처럼 간단하게 적으면 됩니다. subprocess의 call을 이용하며 인자로 list를 전달하는데 첫 번째는 afplay를 적어주고 두 번째에는 재생할 음악 파일이 있는 directory와 음악파일 이름을 적어주면 됩니다. import subprocess subprocess.call(['afplay', 'music/test.wav']) mp3 파일 뿐 아니라 wav 파일도 재생 가능합니다.