Kann mir jemand den python code erklären?
Hi Leute, ich hab ein problem und zwar müsste ich den folgenden python code verstehen und ich wäre euch sehr dankbar wenn ihr mir den ausführlich erklären könntet:
(v.a. ab dem punkt # play stream and find the frequency of each chunk)
# Read in a WAV and find the freq's import pyaudio import wave import numpy as np chunk = 2048 # open up a wave wf = wave.open('mono.wav', 'rb') swidth = wf.getsampwidth() RATE = wf.getframerate() # use a Blackman window window = np.blackman(chunk) # open stream p = pyaudio.PyAudio() stream = p.open(format = p.get_format_from_width(wf.getsampwidth()), channels = wf.getnchannels(), rate = RATE, output = True) # read some data data = wf.readframes(chunk) # play stream and find the frequency of each chunk while len(data) == chunk*swidth: # write data out to the audio stream stream.write(data) # unpack the data and times by the hamming window indata = np.array(wave.struct.unpack("%dh"%(len(data)/swidth),\ data))*window # Take the fft and square each value fftData=abs(np.fft.rfft(indata))**2 # find the maximum which = fftData[1:].argmax() + 1 # use quadratic interpolation around the max if which != len(fftData)-1: y0,y1,y2 = np.log(fftData[which-1:which+2:]) x1 = (y2 - y0) * .5 / (2 * y1 - y2 - y0) # find the frequency and output it thefreq = (which+x1)*RATE/chunk print ("%f Hz." % (thefreq)) else: thefreq = which*RATE/chunk print ("... %f Hz." % (thefreq)) # read some more data data = wf.readframes(chunk) if data: stream.write(data) stream.close() p.terminate()
Sieht nach einem Chunkupdater für ein Videospiel aus, ganz ohne Zusammenhang ist es schwer herauszufinden was es tut bzw für was es das tut.
Welche Programmiersprache ist die beste für mich --__--101?
Mein Ziel wäre es, irgendwann Mal eine App für ein Android-Gerät öffnen zu können, mit eigenen Bildern und Objekten mit eigenem DEsign und so. Ich habe ein paar Erfahrungen mit Python, also Variablen setzen, Arrays, Print Befehl und ein Paar Funktionen.
Ich würde gerne eine Sprache haben die ich kostenlos ganz gut lernen kann und die all das ermöglicht
who, which oder that?
You can't reform a religion (who/which/that?) was founded on the premise that the Bible and Torah were corrupted by men.
Ich tendiere zu "that" bin mir aber nicht ganz sicher.
Kann mir vielleicht jemand die summary korrigieren?
The article “Bag lady” from the magazine mail of Sunday by Rebecca Hosking is about the environment and marine pollution Rebecca Hosking went to Hawaii for a documentary for the BBC . She is a lady which is committed to the environment. Also she wanted to watch the beauty of Hawaii. But when she was there she was shocked about the situation. Because they was a lot of dead albatross chicks and a lot of trash which came from the ocean to hawaii
Berichtigung meiner Erörterung
Hallo! Ich war lange krank und schreibe bald eine Erörterung im Englischen.Deshalb bitte ich jemanden um diese zu berichtigen.
On the Website 'schoolrating.com' can people assess their school.These results are public.The Website is a idea but it could come true.But is the webpage 'schoolrating.com' so good or are there some things which weren't observe?
The main idea is that parents or newcomer in the city can get information about the school.This makes the finding for the right school easier.The school can also react to the critic from the students.
On the ohter side there are some aspects which millitate against 'schoolrating.com'.In the GTC stands that all people can rate the school without any registration.So a hater from the school can rate this school really bad so that less new students come to the school.A student, who hates a teacher, can hold out oneself as a student several times with fake names to rate this teacher so down that he can get problems and maybe get fired.
First I thought the Idea is great.But in the GTC are many things which have to be reworked.Maybe like a censorship of teachers name and a thoughtful registration.The parents or newcomer can get also information from the school.As I see it, the website 'schoolrating.com' is senseless.
Vielen Dank im Vorraus
englisch referat canada wichtig!
Bitte übersetzt mir das richtig mit grammatik und so. Hier ist der Text:
Well, the topic of my presentation is Canada. First of all I’ll tell you briefly what I’m going to talk about:
- general things about Canada
- the capital Ottawa
- national parks
In 1541 the first European colonised Canada. Before that, only Inuit and Eskimos lived there. Now Canada has got only 32.378.200 inhabitants although it is with 9.984.670 km² the second biggest state in the world. It is cut into 13 provinces and territories, which have all their own capitals. Everywhere in Canada you pay with the Canadian Dollar. One Euro is equivalent to about 1Dollar 50. Queen Elizabeth II is shown on the twenty Dollar bill. The most known sights are the “Niagara falls“ which are visited by most of the tourists. One half lies in the province Ontario in Canada, and the other half is in the federal state New York in America. Well, the flag. It is called Maple Leaf Flag, because on it you see a red maple leaf. The two red stripes symbolize the Atlantic and the Pacific Ocean, the two oceans which surround Canada. The colour white represents the arctic fields of snow in the north and the maple-leaf is typical to visualize the great forests of the country. The colour red is to remind people of the murdered soldiers in World War I. The two languages, which are spoken in Canada, are English and French that is because the population consists of 40% English-speaking people, 27% French and 20% other Europeans. And although the Eskimos and the Inuit were the first inhabitants they amount only 1, 5 % of the population.
Ottawa There are the parliament buildings where Canada’s government resides. Ottawa has got 860.000 inhabitants, it’s the fourth largest city and it is the only town which is officially bilingual. (French and English) It is located in the province Ontario.
National parks There are about 40 national parks in Canada. The Wood Buffalo National park is with 44.800 km² the largest one and I’m going to tell you something about it. The park was established in 1922 to protect the world's largest herd of free roaming Wood Bison. The Wood Buffalo National Park contains a large variety of wildlife species, such as black bear, wolf, beaver and white pelican. It contains one of the world's largest fresh water deltas.
Holidays Now I’ll tell you something about the bank holidays. There are many holiday which are the same as in Germany, like New Years Day, Good Friday, Easter Monday and Christmas. But there are some, which can not be found in Germany, for example the Victoria Day. On that day, you honour the acting British monarchs. Or the Canada Day on July 1 where you celebrate the independence of Canada. On that day many flags, fireworks and parades can be seen.
Thats it. Thank you for your attention and I hope you have enjoyed it.
Ich schreib demnächst eine Klausur in Englisch und ich wollte fragen, ob sich jemand das auf Fehler durchlesen könnte :)
Is the American Dream still alive? It's not an easy question to answer, especially in our current times full of uncertainty in our work and in our lives. The basic idea of the American Dream is that anybody can achieve anything, no matter how great the odds are against him or her. Most Americans believed that with a strong will and hard work, anybody can go from
rags to riches. But reality show us something different… First of all, one can say that not everybody has the same equal opportunities, for example different education. Because of the individual community which has to pay teachers from local taxes (property taxes) and mainly coloured people and Hispanies live in regions where local governments do not get lot of taxes because the wort of the properties is quite low. This is the reason why schools in disadvantaged neighbourhoods are in a bad condition and teachers are not highly qualified. That explains why students and inhabitants of these areas has little chances of upward mobility and are often despairing. As a consequence of the bad education, people cannot find a well-paid job so that they can hardly escape from there. In disadvantaged neighborhoods are often a high unemployment rate, a high crime rate and much drugs abuse. As a result of the high unemployment rate are these areas known for poverty. Another point is that there are a large number of broken families and many students who leave school without taking their first exams. The life in disadvantaged neighbourhoods can be compare with a vicious circle. To sum up, one can say that the state does not take care and treat all people equally. Consequently, it grows a gap between the rich one and the poor people in the USA. So that many Americans lose faith of the American Dream.