_speaker.py 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. """
  2. Python script for notes generation
  3. # coding: utf-8
  4. # Python script for notes generation
  5. from typing import List
  6. note_names: List = ['C', 'CS', 'D', 'DS', 'E', 'F', 'FS', 'G', 'GS', 'A', 'AS', 'B']
  7. for octave in range(9):
  8. for name in note_names:
  9. print("SPEAKER_NOTE_%s%s: float" % (name, octave))
  10. print('\'\'\'')
  11. print('The musical note %s\\ :sub:`%s` as frequency in `Hz`.\n' % (name if len(name) == 1 else (name[0]+'#'), octave))
  12. print('.. versionadded:: 1.2.0')
  13. print('.. versionchanged:: 1.7.0')
  14. print(' The constant is replaced by a delegator function.')
  15. print('\'\'\'\n')
  16. """
  17. SPEAKER_NOTE_C0: float
  18. """
  19. The musical note C\ :sub:`0` as frequency in `Hz`.
  20. .. versionadded:: 1.2.0
  21. .. versionchanged:: 1.7.0
  22. The constant is replaced by a delegator function.
  23. '''
  24. SPEAKER_NOTE_CS0: float
  25. """
  26. The musical note C#\ :sub:`0` as frequency in `Hz`.
  27. .. versionadded:: 1.2.0
  28. .. versionchanged:: 1.7.0
  29. The constant is replaced by a delegator function.
  30. '''
  31. SPEAKER_NOTE_D0: float
  32. """
  33. The musical note D\ :sub:`0` as frequency in `Hz`.
  34. .. versionadded:: 1.2.0
  35. .. versionchanged:: 1.7.0
  36. The constant is replaced by a delegator function.
  37. '''
  38. SPEAKER_NOTE_DS0: float
  39. """
  40. The musical note D#\ :sub:`0` as frequency in `Hz`.
  41. .. versionadded:: 1.2.0
  42. .. versionchanged:: 1.7.0
  43. The constant is replaced by a delegator function.
  44. '''
  45. SPEAKER_NOTE_E0: float
  46. """
  47. The musical note E\ :sub:`0` as frequency in `Hz`.
  48. .. versionadded:: 1.2.0
  49. .. versionchanged:: 1.7.0
  50. The constant is replaced by a delegator function.
  51. '''
  52. SPEAKER_NOTE_F0: float
  53. """
  54. The musical note F\ :sub:`0` as frequency in `Hz`.
  55. .. versionadded:: 1.2.0
  56. .. versionchanged:: 1.7.0
  57. The constant is replaced by a delegator function.
  58. '''
  59. SPEAKER_NOTE_FS0: float
  60. """
  61. The musical note F#\ :sub:`0` as frequency in `Hz`.
  62. .. versionadded:: 1.2.0
  63. .. versionchanged:: 1.7.0
  64. The constant is replaced by a delegator function.
  65. '''
  66. SPEAKER_NOTE_G0: float
  67. """
  68. The musical note G\ :sub:`0` as frequency in `Hz`.
  69. .. versionadded:: 1.2.0
  70. .. versionchanged:: 1.7.0
  71. The constant is replaced by a delegator function.
  72. '''
  73. SPEAKER_NOTE_GS0: float
  74. """
  75. The musical note G#\ :sub:`0` as frequency in `Hz`.
  76. .. versionadded:: 1.2.0
  77. .. versionchanged:: 1.7.0
  78. The constant is replaced by a delegator function.
  79. '''
  80. SPEAKER_NOTE_A0: float
  81. """
  82. The musical note A\ :sub:`0` as frequency in `Hz`.
  83. .. versionadded:: 1.2.0
  84. .. versionchanged:: 1.7.0
  85. The constant is replaced by a delegator function.
  86. '''
  87. SPEAKER_NOTE_AS0: float
  88. """
  89. The musical note A#\ :sub:`0` as frequency in `Hz`.
  90. .. versionadded:: 1.2.0
  91. .. versionchanged:: 1.7.0
  92. The constant is replaced by a delegator function.
  93. '''
  94. SPEAKER_NOTE_B0: float
  95. """
  96. The musical note B\ :sub:`0` as frequency in `Hz`.
  97. .. versionadded:: 1.2.0
  98. .. versionchanged:: 1.7.0
  99. The constant is replaced by a delegator function.
  100. '''
  101. SPEAKER_NOTE_C1: float
  102. '''
  103. The musical note C\ :sub:`1` as frequency in `Hz`.
  104. .. versionadded:: 1.2.0
  105. .. versionchanged:: 1.7.0
  106. The constant is replaced by a delegator function.
  107. '''
  108. SPEAKER_NOTE_CS1: float
  109. '''
  110. The musical note C#\ :sub:`1` as frequency in `Hz`.
  111. .. versionadded:: 1.2.0
  112. .. versionchanged:: 1.7.0
  113. The constant is replaced by a delegator function.
  114. '''
  115. SPEAKER_NOTE_D1: float
  116. '''
  117. The musical note D\ :sub:`1` as frequency in `Hz`.
  118. .. versionadded:: 1.2.0
  119. .. versionchanged:: 1.7.0
  120. The constant is replaced by a delegator function.
  121. '''
  122. SPEAKER_NOTE_DS1: float
  123. '''
  124. The musical note D#\ :sub:`1` as frequency in `Hz`.
  125. .. versionadded:: 1.2.0
  126. .. versionchanged:: 1.7.0
  127. The constant is replaced by a delegator function.
  128. '''
  129. SPEAKER_NOTE_E1: float
  130. '''
  131. The musical note E\ :sub:`1` as frequency in `Hz`.
  132. .. versionadded:: 1.2.0
  133. .. versionchanged:: 1.7.0
  134. The constant is replaced by a delegator function.
  135. '''
  136. SPEAKER_NOTE_F1: float
  137. '''
  138. The musical note F\ :sub:`1` as frequency in `Hz`.
  139. .. versionadded:: 1.2.0
  140. .. versionchanged:: 1.7.0
  141. The constant is replaced by a delegator function.
  142. '''
  143. SPEAKER_NOTE_FS1: float
  144. '''
  145. The musical note F#\ :sub:`1` as frequency in `Hz`.
  146. .. versionadded:: 1.2.0
  147. .. versionchanged:: 1.7.0
  148. The constant is replaced by a delegator function.
  149. '''
  150. SPEAKER_NOTE_G1: float
  151. '''
  152. The musical note G\ :sub:`1` as frequency in `Hz`.
  153. .. versionadded:: 1.2.0
  154. .. versionchanged:: 1.7.0
  155. The constant is replaced by a delegator function.
  156. '''
  157. SPEAKER_NOTE_GS1: float
  158. '''
  159. The musical note G#\ :sub:`1` as frequency in `Hz`.
  160. .. versionadded:: 1.2.0
  161. .. versionchanged:: 1.7.0
  162. The constant is replaced by a delegator function.
  163. '''
  164. SPEAKER_NOTE_A1: float
  165. '''
  166. The musical note A\ :sub:`1` as frequency in `Hz`.
  167. .. versionadded:: 1.2.0
  168. .. versionchanged:: 1.7.0
  169. The constant is replaced by a delegator function.
  170. '''
  171. SPEAKER_NOTE_AS1: float
  172. '''
  173. The musical note A#\ :sub:`1` as frequency in `Hz`.
  174. .. versionadded:: 1.2.0
  175. .. versionchanged:: 1.7.0
  176. The constant is replaced by a delegator function.
  177. '''
  178. SPEAKER_NOTE_B1: float
  179. '''
  180. The musical note B\ :sub:`1` as frequency in `Hz`.
  181. .. versionadded:: 1.2.0
  182. .. versionchanged:: 1.7.0
  183. The constant is replaced by a delegator function.
  184. '''
  185. SPEAKER_NOTE_C2: float
  186. '''
  187. The musical note C\ :sub:`2` as frequency in `Hz`.
  188. .. versionadded:: 1.2.0
  189. .. versionchanged:: 1.7.0
  190. The constant is replaced by a delegator function.
  191. '''
  192. SPEAKER_NOTE_CS2: float
  193. '''
  194. The musical note C#\ :sub:`2` as frequency in `Hz`.
  195. .. versionadded:: 1.2.0
  196. .. versionchanged:: 1.7.0
  197. The constant is replaced by a delegator function.
  198. '''
  199. SPEAKER_NOTE_D2: float
  200. '''
  201. The musical note D\ :sub:`2` as frequency in `Hz`.
  202. .. versionadded:: 1.2.0
  203. .. versionchanged:: 1.7.0
  204. The constant is replaced by a delegator function.
  205. '''
  206. SPEAKER_NOTE_DS2: float
  207. '''
  208. The musical note D#\ :sub:`2` as frequency in `Hz`.
  209. .. versionadded:: 1.2.0
  210. .. versionchanged:: 1.7.0
  211. The constant is replaced by a delegator function.
  212. '''
  213. SPEAKER_NOTE_E2: float
  214. '''
  215. The musical note E\ :sub:`2` as frequency in `Hz`.
  216. .. versionadded:: 1.2.0
  217. .. versionchanged:: 1.7.0
  218. The constant is replaced by a delegator function.
  219. '''
  220. SPEAKER_NOTE_F2: float
  221. '''
  222. The musical note F\ :sub:`2` as frequency in `Hz`.
  223. .. versionadded:: 1.2.0
  224. .. versionchanged:: 1.7.0
  225. The constant is replaced by a delegator function.
  226. '''
  227. SPEAKER_NOTE_FS2: float
  228. '''
  229. The musical note F#\ :sub:`2` as frequency in `Hz`.
  230. .. versionadded:: 1.2.0
  231. .. versionchanged:: 1.7.0
  232. The constant is replaced by a delegator function.
  233. '''
  234. SPEAKER_NOTE_G2: float
  235. '''
  236. The musical note G\ :sub:`2` as frequency in `Hz`.
  237. .. versionadded:: 1.2.0
  238. .. versionchanged:: 1.7.0
  239. The constant is replaced by a delegator function.
  240. '''
  241. SPEAKER_NOTE_GS2: float
  242. '''
  243. The musical note G#\ :sub:`2` as frequency in `Hz`.
  244. .. versionadded:: 1.2.0
  245. .. versionchanged:: 1.7.0
  246. The constant is replaced by a delegator function.
  247. '''
  248. SPEAKER_NOTE_A2: float
  249. '''
  250. The musical note A\ :sub:`2` as frequency in `Hz`.
  251. .. versionadded:: 1.2.0
  252. .. versionchanged:: 1.7.0
  253. The constant is replaced by a delegator function.
  254. '''
  255. SPEAKER_NOTE_AS2: float
  256. '''
  257. The musical note A#\ :sub:`2` as frequency in `Hz`.
  258. .. versionadded:: 1.2.0
  259. .. versionchanged:: 1.7.0
  260. The constant is replaced by a delegator function.
  261. '''
  262. SPEAKER_NOTE_B2: float
  263. '''
  264. The musical note B\ :sub:`2` as frequency in `Hz`.
  265. .. versionadded:: 1.2.0
  266. .. versionchanged:: 1.7.0
  267. The constant is replaced by a delegator function.
  268. '''
  269. SPEAKER_NOTE_C3: float
  270. '''
  271. The musical note C\ :sub:`3` as frequency in `Hz`.
  272. .. versionadded:: 1.2.0
  273. .. versionchanged:: 1.7.0
  274. The constant is replaced by a delegator function.
  275. '''
  276. SPEAKER_NOTE_CS3: float
  277. '''
  278. The musical note C#\ :sub:`3` as frequency in `Hz`.
  279. .. versionadded:: 1.2.0
  280. .. versionchanged:: 1.7.0
  281. The constant is replaced by a delegator function.
  282. '''
  283. SPEAKER_NOTE_D3: float
  284. '''
  285. The musical note D\ :sub:`3` as frequency in `Hz`.
  286. .. versionadded:: 1.2.0
  287. .. versionchanged:: 1.7.0
  288. The constant is replaced by a delegator function.
  289. '''
  290. SPEAKER_NOTE_DS3: float
  291. '''
  292. The musical note D#\ :sub:`3` as frequency in `Hz`.
  293. .. versionadded:: 1.2.0
  294. .. versionchanged:: 1.7.0
  295. The constant is replaced by a delegator function.
  296. '''
  297. SPEAKER_NOTE_E3: float
  298. '''
  299. The musical note E\ :sub:`3` as frequency in `Hz`.
  300. .. versionadded:: 1.2.0
  301. .. versionchanged:: 1.7.0
  302. The constant is replaced by a delegator function.
  303. '''
  304. SPEAKER_NOTE_F3: float
  305. '''
  306. The musical note F\ :sub:`3` as frequency in `Hz`.
  307. .. versionadded:: 1.2.0
  308. .. versionchanged:: 1.7.0
  309. The constant is replaced by a delegator function.
  310. '''
  311. SPEAKER_NOTE_FS3: float
  312. '''
  313. The musical note F#\ :sub:`3` as frequency in `Hz`.
  314. .. versionadded:: 1.2.0
  315. .. versionchanged:: 1.7.0
  316. The constant is replaced by a delegator function.
  317. '''
  318. SPEAKER_NOTE_G3: float
  319. '''
  320. The musical note G\ :sub:`3` as frequency in `Hz`.
  321. .. versionadded:: 1.2.0
  322. .. versionchanged:: 1.7.0
  323. The constant is replaced by a delegator function.
  324. '''
  325. SPEAKER_NOTE_GS3: float
  326. '''
  327. The musical note G#\ :sub:`3` as frequency in `Hz`.
  328. .. versionadded:: 1.2.0
  329. .. versionchanged:: 1.7.0
  330. The constant is replaced by a delegator function.
  331. '''
  332. SPEAKER_NOTE_A3: float
  333. '''
  334. The musical note A\ :sub:`3` as frequency in `Hz`.
  335. .. versionadded:: 1.2.0
  336. .. versionchanged:: 1.7.0
  337. The constant is replaced by a delegator function.
  338. '''
  339. SPEAKER_NOTE_AS3: float
  340. '''
  341. The musical note A#\ :sub:`3` as frequency in `Hz`.
  342. .. versionadded:: 1.2.0
  343. .. versionchanged:: 1.7.0
  344. The constant is replaced by a delegator function.
  345. '''
  346. SPEAKER_NOTE_B3: float
  347. '''
  348. The musical note B\ :sub:`3` as frequency in `Hz`.
  349. .. versionadded:: 1.2.0
  350. .. versionchanged:: 1.7.0
  351. The constant is replaced by a delegator function.
  352. '''
  353. SPEAKER_NOTE_C4: float
  354. '''
  355. The musical note C\ :sub:`4` as frequency in `Hz`.
  356. .. versionadded:: 1.2.0
  357. .. versionchanged:: 1.7.0
  358. The constant is replaced by a delegator function.
  359. '''
  360. SPEAKER_NOTE_CS4: float
  361. '''
  362. The musical note C#\ :sub:`4` as frequency in `Hz`.
  363. .. versionadded:: 1.2.0
  364. .. versionchanged:: 1.7.0
  365. The constant is replaced by a delegator function.
  366. '''
  367. SPEAKER_NOTE_D4: float
  368. '''
  369. The musical note D\ :sub:`4` as frequency in `Hz`.
  370. .. versionadded:: 1.2.0
  371. .. versionchanged:: 1.7.0
  372. The constant is replaced by a delegator function.
  373. '''
  374. SPEAKER_NOTE_DS4: float
  375. '''
  376. The musical note D#\ :sub:`4` as frequency in `Hz`.
  377. .. versionadded:: 1.2.0
  378. .. versionchanged:: 1.7.0
  379. The constant is replaced by a delegator function.
  380. '''
  381. SPEAKER_NOTE_E4: float
  382. '''
  383. The musical note E\ :sub:`4` as frequency in `Hz`.
  384. .. versionadded:: 1.2.0
  385. .. versionchanged:: 1.7.0
  386. The constant is replaced by a delegator function.
  387. '''
  388. SPEAKER_NOTE_F4: float
  389. '''
  390. The musical note F\ :sub:`4` as frequency in `Hz`.
  391. .. versionadded:: 1.2.0
  392. .. versionchanged:: 1.7.0
  393. The constant is replaced by a delegator function.
  394. '''
  395. SPEAKER_NOTE_FS4: float
  396. '''
  397. The musical note F#\ :sub:`4` as frequency in `Hz`.
  398. .. versionadded:: 1.2.0
  399. .. versionchanged:: 1.7.0
  400. The constant is replaced by a delegator function.
  401. '''
  402. SPEAKER_NOTE_G4: float
  403. '''
  404. The musical note G\ :sub:`4` as frequency in `Hz`.
  405. .. versionadded:: 1.2.0
  406. .. versionchanged:: 1.7.0
  407. The constant is replaced by a delegator function.
  408. '''
  409. SPEAKER_NOTE_GS4: float
  410. '''
  411. The musical note G#\ :sub:`4` as frequency in `Hz`.
  412. .. versionadded:: 1.2.0
  413. .. versionchanged:: 1.7.0
  414. The constant is replaced by a delegator function.
  415. '''
  416. SPEAKER_NOTE_A4: float
  417. '''
  418. The musical note A\ :sub:`4` as frequency in `Hz`.
  419. .. versionadded:: 1.2.0
  420. .. versionchanged:: 1.7.0
  421. The constant is replaced by a delegator function.
  422. '''
  423. SPEAKER_NOTE_AS4: float
  424. '''
  425. The musical note A#\ :sub:`4` as frequency in `Hz`.
  426. .. versionadded:: 1.2.0
  427. .. versionchanged:: 1.7.0
  428. The constant is replaced by a delegator function.
  429. '''
  430. SPEAKER_NOTE_B4: float
  431. '''
  432. The musical note B\ :sub:`4` as frequency in `Hz`.
  433. .. versionadded:: 1.2.0
  434. .. versionchanged:: 1.7.0
  435. The constant is replaced by a delegator function.
  436. '''
  437. SPEAKER_NOTE_C5: float
  438. '''
  439. The musical note C\ :sub:`5` as frequency in `Hz`.
  440. .. versionadded:: 1.2.0
  441. .. versionchanged:: 1.7.0
  442. The constant is replaced by a delegator function.
  443. '''
  444. SPEAKER_NOTE_CS5: float
  445. '''
  446. The musical note C#\ :sub:`5` as frequency in `Hz`.
  447. .. versionadded:: 1.2.0
  448. .. versionchanged:: 1.7.0
  449. The constant is replaced by a delegator function.
  450. '''
  451. SPEAKER_NOTE_D5: float
  452. '''
  453. The musical note D\ :sub:`5` as frequency in `Hz`.
  454. .. versionadded:: 1.2.0
  455. .. versionchanged:: 1.7.0
  456. The constant is replaced by a delegator function.
  457. '''
  458. SPEAKER_NOTE_DS5: float
  459. '''
  460. The musical note D#\ :sub:`5` as frequency in `Hz`.
  461. .. versionadded:: 1.2.0
  462. .. versionchanged:: 1.7.0
  463. The constant is replaced by a delegator function.
  464. '''
  465. SPEAKER_NOTE_E5: float
  466. '''
  467. The musical note E\ :sub:`5` as frequency in `Hz`.
  468. .. versionadded:: 1.2.0
  469. .. versionchanged:: 1.7.0
  470. The constant is replaced by a delegator function.
  471. '''
  472. SPEAKER_NOTE_F5: float
  473. '''
  474. The musical note F\ :sub:`5` as frequency in `Hz`.
  475. .. versionadded:: 1.2.0
  476. .. versionchanged:: 1.7.0
  477. The constant is replaced by a delegator function.
  478. '''
  479. SPEAKER_NOTE_FS5: float
  480. '''
  481. The musical note F#\ :sub:`5` as frequency in `Hz`.
  482. .. versionadded:: 1.2.0
  483. .. versionchanged:: 1.7.0
  484. The constant is replaced by a delegator function.
  485. '''
  486. SPEAKER_NOTE_G5: float
  487. '''
  488. The musical note G\ :sub:`5` as frequency in `Hz`.
  489. .. versionadded:: 1.2.0
  490. .. versionchanged:: 1.7.0
  491. The constant is replaced by a delegator function.
  492. '''
  493. SPEAKER_NOTE_GS5: float
  494. '''
  495. The musical note G#\ :sub:`5` as frequency in `Hz`.
  496. .. versionadded:: 1.2.0
  497. .. versionchanged:: 1.7.0
  498. The constant is replaced by a delegator function.
  499. '''
  500. SPEAKER_NOTE_A5: float
  501. '''
  502. The musical note A\ :sub:`5` as frequency in `Hz`.
  503. .. versionadded:: 1.2.0
  504. .. versionchanged:: 1.7.0
  505. The constant is replaced by a delegator function.
  506. '''
  507. SPEAKER_NOTE_AS5: float
  508. '''
  509. The musical note A#\ :sub:`5` as frequency in `Hz`.
  510. .. versionadded:: 1.2.0
  511. .. versionchanged:: 1.7.0
  512. The constant is replaced by a delegator function.
  513. '''
  514. SPEAKER_NOTE_B5: float
  515. '''
  516. The musical note B\ :sub:`5` as frequency in `Hz`.
  517. .. versionadded:: 1.2.0
  518. .. versionchanged:: 1.7.0
  519. The constant is replaced by a delegator function.
  520. '''
  521. SPEAKER_NOTE_C6: float
  522. '''
  523. The musical note C\ :sub:`6` as frequency in `Hz`.
  524. .. versionadded:: 1.2.0
  525. .. versionchanged:: 1.7.0
  526. The constant is replaced by a delegator function.
  527. '''
  528. SPEAKER_NOTE_CS6: float
  529. '''
  530. The musical note C#\ :sub:`6` as frequency in `Hz`.
  531. .. versionadded:: 1.2.0
  532. .. versionchanged:: 1.7.0
  533. The constant is replaced by a delegator function.
  534. '''
  535. SPEAKER_NOTE_D6: float
  536. '''
  537. The musical note D\ :sub:`6` as frequency in `Hz`.
  538. .. versionadded:: 1.2.0
  539. .. versionchanged:: 1.7.0
  540. The constant is replaced by a delegator function.
  541. '''
  542. SPEAKER_NOTE_DS6: float
  543. '''
  544. The musical note D#\ :sub:`6` as frequency in `Hz`.
  545. .. versionadded:: 1.2.0
  546. .. versionchanged:: 1.7.0
  547. The constant is replaced by a delegator function.
  548. '''
  549. SPEAKER_NOTE_E6: float
  550. '''
  551. The musical note E\ :sub:`6` as frequency in `Hz`.
  552. .. versionadded:: 1.2.0
  553. .. versionchanged:: 1.7.0
  554. The constant is replaced by a delegator function.
  555. '''
  556. SPEAKER_NOTE_F6: float
  557. '''
  558. The musical note F\ :sub:`6` as frequency in `Hz`.
  559. .. versionadded:: 1.2.0
  560. .. versionchanged:: 1.7.0
  561. The constant is replaced by a delegator function.
  562. '''
  563. SPEAKER_NOTE_FS6: float
  564. '''
  565. The musical note F#\ :sub:`6` as frequency in `Hz`.
  566. .. versionadded:: 1.2.0
  567. .. versionchanged:: 1.7.0
  568. The constant is replaced by a delegator function.
  569. '''
  570. SPEAKER_NOTE_G6: float
  571. '''
  572. The musical note G\ :sub:`6` as frequency in `Hz`.
  573. .. versionadded:: 1.2.0
  574. .. versionchanged:: 1.7.0
  575. The constant is replaced by a delegator function.
  576. '''
  577. SPEAKER_NOTE_GS6: float
  578. '''
  579. The musical note G#\ :sub:`6` as frequency in `Hz`.
  580. .. versionadded:: 1.2.0
  581. .. versionchanged:: 1.7.0
  582. The constant is replaced by a delegator function.
  583. '''
  584. SPEAKER_NOTE_A6: float
  585. '''
  586. The musical note A\ :sub:`6` as frequency in `Hz`.
  587. .. versionadded:: 1.2.0
  588. .. versionchanged:: 1.7.0
  589. The constant is replaced by a delegator function.
  590. '''
  591. SPEAKER_NOTE_AS6: float
  592. '''
  593. The musical note A#\ :sub:`6` as frequency in `Hz`.
  594. .. versionadded:: 1.2.0
  595. .. versionchanged:: 1.7.0
  596. The constant is replaced by a delegator function.
  597. '''
  598. SPEAKER_NOTE_B6: float
  599. '''
  600. The musical note B\ :sub:`6` as frequency in `Hz`.
  601. .. versionadded:: 1.2.0
  602. .. versionchanged:: 1.7.0
  603. The constant is replaced by a delegator function.
  604. '''
  605. SPEAKER_NOTE_C7: float
  606. '''
  607. The musical note C\ :sub:`7` as frequency in `Hz`.
  608. .. versionadded:: 1.2.0
  609. .. versionchanged:: 1.7.0
  610. The constant is replaced by a delegator function.
  611. '''
  612. SPEAKER_NOTE_CS7: float
  613. '''
  614. The musical note C#\ :sub:`7` as frequency in `Hz`.
  615. .. versionadded:: 1.2.0
  616. .. versionchanged:: 1.7.0
  617. The constant is replaced by a delegator function.
  618. '''
  619. SPEAKER_NOTE_D7: float
  620. '''
  621. The musical note D\ :sub:`7` as frequency in `Hz`.
  622. .. versionadded:: 1.2.0
  623. .. versionchanged:: 1.7.0
  624. The constant is replaced by a delegator function.
  625. '''
  626. SPEAKER_NOTE_DS7: float
  627. '''
  628. The musical note D#\ :sub:`7` as frequency in `Hz`.
  629. .. versionadded:: 1.2.0
  630. .. versionchanged:: 1.7.0
  631. The constant is replaced by a delegator function.
  632. '''
  633. SPEAKER_NOTE_E7: float
  634. '''
  635. The musical note E\ :sub:`7` as frequency in `Hz`.
  636. .. versionadded:: 1.2.0
  637. .. versionchanged:: 1.7.0
  638. The constant is replaced by a delegator function.
  639. '''
  640. SPEAKER_NOTE_F7: float
  641. '''
  642. The musical note F\ :sub:`7` as frequency in `Hz`.
  643. .. versionadded:: 1.2.0
  644. .. versionchanged:: 1.7.0
  645. The constant is replaced by a delegator function.
  646. '''
  647. SPEAKER_NOTE_FS7: float
  648. '''
  649. The musical note F#\ :sub:`7` as frequency in `Hz`.
  650. .. versionadded:: 1.2.0
  651. .. versionchanged:: 1.7.0
  652. The constant is replaced by a delegator function.
  653. '''
  654. SPEAKER_NOTE_G7: float
  655. '''
  656. The musical note G\ :sub:`7` as frequency in `Hz`.
  657. .. versionadded:: 1.2.0
  658. .. versionchanged:: 1.7.0
  659. The constant is replaced by a delegator function.
  660. '''
  661. SPEAKER_NOTE_GS7: float
  662. '''
  663. The musical note G#\ :sub:`7` as frequency in `Hz`.
  664. .. versionadded:: 1.2.0
  665. .. versionchanged:: 1.7.0
  666. The constant is replaced by a delegator function.
  667. '''
  668. SPEAKER_NOTE_A7: float
  669. '''
  670. The musical note A\ :sub:`7` as frequency in `Hz`.
  671. .. versionadded:: 1.2.0
  672. .. versionchanged:: 1.7.0
  673. The constant is replaced by a delegator function.
  674. '''
  675. SPEAKER_NOTE_AS7: float
  676. '''
  677. The musical note A#\ :sub:`7` as frequency in `Hz`.
  678. .. versionadded:: 1.2.0
  679. .. versionchanged:: 1.7.0
  680. The constant is replaced by a delegator function.
  681. '''
  682. SPEAKER_NOTE_B7: float
  683. '''
  684. The musical note B\ :sub:`7` as frequency in `Hz`.
  685. .. versionadded:: 1.2.0
  686. .. versionchanged:: 1.7.0
  687. The constant is replaced by a delegator function.
  688. '''
  689. SPEAKER_NOTE_C8: float
  690. '''
  691. The musical note C\ :sub:`8` as frequency in `Hz`.
  692. .. versionadded:: 1.2.0
  693. .. versionchanged:: 1.7.0
  694. The constant is replaced by a delegator function.
  695. '''
  696. SPEAKER_NOTE_CS8: float
  697. '''
  698. The musical note C#\ :sub:`8` as frequency in `Hz`.
  699. .. versionadded:: 1.2.0
  700. .. versionchanged:: 1.7.0
  701. The constant is replaced by a delegator function.
  702. '''
  703. SPEAKER_NOTE_D8: float
  704. '''
  705. The musical note D\ :sub:`8` as frequency in `Hz`.
  706. .. versionadded:: 1.2.0
  707. .. versionchanged:: 1.7.0
  708. The constant is replaced by a delegator function.
  709. '''
  710. SPEAKER_NOTE_DS8: float
  711. '''
  712. The musical note D#\ :sub:`8` as frequency in `Hz`.
  713. .. versionadded:: 1.2.0
  714. .. versionchanged:: 1.7.0
  715. The constant is replaced by a delegator function.
  716. '''
  717. SPEAKER_NOTE_E8: float
  718. '''
  719. The musical note E\ :sub:`8` as frequency in `Hz`.
  720. .. versionadded:: 1.2.0
  721. .. versionchanged:: 1.7.0
  722. The constant is replaced by a delegator function.
  723. '''
  724. SPEAKER_NOTE_F8: float
  725. '''
  726. The musical note F\ :sub:`8` as frequency in `Hz`.
  727. .. versionadded:: 1.2.0
  728. .. versionchanged:: 1.7.0
  729. The constant is replaced by a delegator function.
  730. '''
  731. SPEAKER_NOTE_FS8: float
  732. '''
  733. The musical note F#\ :sub:`8` as frequency in `Hz`.
  734. .. versionadded:: 1.2.0
  735. .. versionchanged:: 1.7.0
  736. The constant is replaced by a delegator function.
  737. '''
  738. SPEAKER_NOTE_G8: float
  739. '''
  740. The musical note G\ :sub:`8` as frequency in `Hz`.
  741. .. versionadded:: 1.2.0
  742. .. versionchanged:: 1.7.0
  743. The constant is replaced by a delegator function.
  744. '''
  745. SPEAKER_NOTE_GS8: float
  746. '''
  747. The musical note G#\ :sub:`8` as frequency in `Hz`.
  748. .. versionadded:: 1.2.0
  749. .. versionchanged:: 1.7.0
  750. The constant is replaced by a delegator function.
  751. '''
  752. SPEAKER_NOTE_A8: float
  753. '''
  754. The musical note A\ :sub:`8` as frequency in `Hz`.
  755. .. versionadded:: 1.2.0
  756. .. versionchanged:: 1.7.0
  757. The constant is replaced by a delegator function.
  758. '''
  759. SPEAKER_NOTE_AS8: float
  760. '''
  761. The musical note A#\ :sub:`8` as frequency in `Hz`.
  762. .. versionadded:: 1.2.0
  763. .. versionchanged:: 1.7.0
  764. The constant is replaced by a delegator function.
  765. '''
  766. SPEAKER_NOTE_B8: float
  767. '''
  768. The musical note B\ :sub:`8` as frequency in `Hz`.
  769. .. versionadded:: 1.2.0
  770. .. versionchanged:: 1.7.0
  771. The constant is replaced by a delegator function.
  772. '''
  773. SPEAKER_VOLUME_MIN: float
  774. """
  775. The minimal volume value.
  776. .. versionadded:: 1.2.0
  777. """
  778. SPEAKER_VOLUME_MAX: float
  779. """
  780. The maximum volume value.
  781. .. versionadded:: 1.2.0
  782. """
  783. def speaker_start(frequency: float, volume: float) -> bool:
  784. """
  785. Output a steady tone of a defined frequency and volume on the Flipper's speaker.
  786. This is a non-blocking operation. The tone will continue until you call :func:`speaker_stop`.
  787. The ``volume`` parameter accepts values from :py:const:`SPEAKER_VOLUME_MIN` (silent) up to :py:const:`SPEAKER_VOLUME_MAX` (very loud).
  788. :param frequency: The frequency to play in `Hz <https://en.wikipedia.org/wiki/Hertz>`_.
  789. :param volume: The volume to use.
  790. :returns: :const:`True` if the speaker was acquired.
  791. .. versionadded:: 1.0.0
  792. .. code-block::
  793. import flipperzero as f0
  794. f0.speaker_start(50.0, 0.8)
  795. """
  796. pass
  797. def speaker_set_volume(volume: float) -> bool:
  798. """
  799. Set the speaker's volume while playing a tone. This is a non-blocking operation.
  800. The tone will continue until you call :func:`speaker_stop`.
  801. The ``volume`` parameter accepts values from 0.0 (silent) up to 1.0 (very loud).
  802. :param volume: The volume to use.
  803. :returns: :const:`True` if the speaker was acquired.
  804. .. versionadded:: 1.0.0
  805. This function can be used to play `nice` sounds:
  806. .. code-block::
  807. import time
  808. import flipperzero as f0
  809. volume = 0.8
  810. f0.speaker_start(100.0, volume)
  811. for _ in range(0, 150):
  812. volume *= 0.9945679
  813. f0.speaker_set_volume(volume)
  814. time.sleep_ms(1)
  815. f0.speaker_stop()
  816. """
  817. pass
  818. def speaker_stop() -> bool:
  819. """
  820. Stop the speaker output.
  821. :returns: :const:`True` if the speaker was successfully released.
  822. .. versionadded:: 1.0.0
  823. """
  824. pass