跨浏览器问题:Web音频API和事件监听器

时间:2018-11-01 18:10:41

标签: javascript eventhandler web-audio-api

我制作了一个音乐定序器,可以使用网络音频进行录制。我的JavaScript中有很多点击事件,例如:

model = Sequential()
model.add(LSTM(int(128), input_shape=(timesteps, int(128)),return_sequences=False))
model.add(Dropout(0.2))
model.add(Dense(20, activation='relu', input_shape=(128,),kernel_initializer=initializers.glorot_uniform(seed=0)))
model.add(Dropout(0.2))
model.add(Dense(20, activation='softmax'))

model.add(Dense(2, activation='softmax')) 

model.compile(loss='categorical_crossentropy', optimizer='adam',metrics=['accuracy'])

### fit model

model.fit(X_train, Y_train, batch_size=batch_size, epochs= epochs, verbose=1, validation_data=(X_test, Y_test))

####Applying K-fold cross validation
classifier = KerasClassifier(build_fn=binary_classify_lstm_fc_model(), batch_size=10, epochs=100, verbose=0)
accuracies = cross_val_score(estimator= classifier, X = X_train, y = Y_train, cv=10, scoring="accuracy")#n_jobs= -1
print(accuracies)

“暂停”和“开始”是按钮,“ isActiveCtr”是CSS中按钮的颜色更改。一切都适用于Chrome,声音不会播放,但单击事件更改在IE中有效,而在Safari中则无效。

我将如何更改事件监听器以使其跨浏览器工作?

0 个答案:

没有答案