【鼎革‧革鼎】︰ Raspbian Stretch 《六之 K.2-sd.VIII 》

今天是自由日,什麼是自由呢?維基百科詞條這麼說︰

自由英語:freedom)有多種含義:

  1. 意指由憲法基本法所保障的一種權利或自由權,包括政府在內任何人都不可以不起訴或以莫須有的罪名而拘捕扣留任何人。[1]
  2. 把個人從某些非政府的私權力中解放, 如奴隸主父母丈夫軍閥地主資本家等。
  3. 任性意義的自由。想說什麼就說什麼,想做什麼就做什麼。自由放任
  4. 規律辦事意義下的自由,所謂對必然的認識和改造。
  5. 自律英語:autonomous)意義下的自由。康德在此意義上使用自由一詞。
  6. 是人在自己所擁有的領域自主追求自己設定目標的權利
  7. 不干涉別人的私人生活,只要不危害旁人就不應當禁制,如個人的私有財產隱私性取向信仰政治主張、嗜好,但對於怎樣界定有嚴重的分歧,這也是到底放縱和自律的定義標準問題。
  8. 把被外國侵略中解放殖民地領土,恢復獨立或歸還原有國家的 。
  9. 不具有性別意識、思想,認為性別是對自己和人身自由的一種限制 。

法國19世紀畫家德拉克羅瓦名畫:自由引導人民

法國大革命綱領性文件《人權宣言》中,對自由的定義為:

自由即有權做一切無害於他人的任何事情。
— 法國大革命綱領性文件《人權宣言》第4條(節選),1789年

絕對的自由在理論上可能存在,但由於社會是由人與人所組成,自由不僅是個人的議題,而是社會中各個主體之間彼此互相界定的程度,因此托馬斯·傑斐遜認為個人的自由受制於他人的同等的自由。進而有人認為[誰?]自由與責任相關,有相關之自由即應負相關之責任。自由的邊界是人權,自由止於人權。

自由是政治哲學的核心概念。自由也是一種社會概念。自由是社會人的權利。與自由相對的,是奴役

孫中山多次在演講中引述彌爾的話指出,一個人的自由,以不侵犯他人的自由為範圍,才是真自由。如果侵犯他人的範圍,便是不自由[2]

第二次世界大戰中(1941年1月6日),美國總統羅斯福在國情咨文中提出了著名的「四大自由[3]

在未來的日子裡,我們嚮往並需要確保一個由必要的人類自由構成的世界: 第一,言論與表達的自由——在世界上的所有地方。 第二,一切人民以自己的方式崇拜他們神祇的自由——在世界上的所有地方。 第三,免於匱乏的自由——以世界性的角度來說,可使每一個國家的所有居民享受在和平時期健康生活的經濟基礎——在世界上的所有地方。 第四,免於恐懼的自由——以世界性的角度來說,全球的兵力削減以至於任何國家都沒有對其鄰邦進行武力入侵的可能——在世界上的任何地方。

——富蘭克林·德拉諾·羅斯福,美利堅合眾國國情咨文 ,1941年1月6日

簡略來說,這四大自由便是言論自由宗教自由免於匱乏的自由免於恐懼的自由

聯合國世界人權宣言重申了這四大自由的精神:「人人享有言論和信仰自由並免予恐懼和匱乏」(《世界人權宣言》)

20世紀下半葉,以賽亞·伯林開始用「兩種自由」的概念來劃分自由 :「消極自由」和「積極自由」。他認為,積極自由是指人在「主動  」意義上的自由,即作為主體的 人做的決定和選擇,均基於自身的主動意志而非任何外部力量。當一個人是自主的或自決的,他就處於「積極」自由的狀態之中。這種自由是「去做……的自由」。 而消極自由指的是在「被動」意義上的自由。即人在意志上不受他人的強制 ,在行為上不受他人的干涉,也就是「免於強制和干涉」的狀態。

 

或許善於傾聽,話語溫暖,樂在分享,自然心靈自由自在吧!

偶遇 SD 回呼串流歸結也。

Callback Streams

Callback “wire” with sounddevice.Stream:

import sounddevice as sd
duration = 5.5  # seconds

def callback(indata, outdata, frames, time, status):
    if status:
        print(status)
    outdata[:] = indata

with sd.Stream(channels=2, callback=callback):
    sd.sleep(int(duration * 1000))

Same thing with sounddevice.RawStream:

import sounddevice as sd
duration = 5.5  # seconds

def callback(indata, outdata, frames, time, status):
    if status:
        print(status)
    outdata[:] = indata

with sd.RawStream(channels=2, dtype='int24', callback=callback):
    sd.sleep(int(duration * 1000))

※ 參考

class sounddevice.Stream(samplerate=None, blocksize=None, device=None, channels=None, dtype=None, latency=None, extra_settings=None, callback=None, finished_callback=None, clip_off=None, dither_off=None, never_drop_input=None, prime_output_buffers_using_stream_callback=None)

Open a stream for simultaneous input and output.

To open an input-only or output-only stream use InputStream or OutputStream, respectively. If you want to handle audio data as plain buffer objects instead of NumPy arrays, use RawStream, RawInputStream or RawOutputStream.

A single stream can provide multiple channels of real-time streaming audio input and output to a client application. A stream provides access to audio hardware represented by one or more devices. Depending on the underlying host API, it may be possible to open multiple streams using the same device, however this behavior is implementation defined. Portable applications should assume that a device may be simultaneously used by at most one stream.

The arguments device, channels, dtype and latency can be either single values (which will be used for both input and output parameters) or pairs of values (where the first one is the value for the input and the second one for the output).

All arguments are optional, the values for unspecified parameters are taken from the default object. If one of the values of a parameter pair is None, the corresponding value from default will be used instead.

The created stream is inactive (see active, stopped). It can be started with start().

Every stream object is also a context manager, i.e. it can be used in a with statement to automatically call start() in the beginning of the statement and stop() and close() on exit.

………