UWP - 找不到PhoneLine

时间:2016-04-24 15:13:53

标签: c# win-universal-app

我试图通过我的应用程序拨打电话。我应该使用名称空间Windows.ApplicationModel.Calls;中的PhoneLine。但是Windows.ApplicationModel.Calls;不在Windows.ApplicationModel.Calls.PhoneLine,但根据documentation它应该在那里。当我将它添加到像The type name 'PhoneLine' could not be found in the namespace 'Windows.ApplicationModel.Calls'. This type has been forwarded to assembly 'Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublickKeyToken=null, ContentType=WindowsRuntime'. Consider adding a reference to that assembly.这样的源代码并将鼠标悬停在它上面时,会有一个提示:

PhoneLine

因此,我尝试通过Windows.Foundation.UniversalApiContract'访问PhoneLine,但VS表示Windows.Foundation.UniversalApiContract eighter中不存在Phone Call

我在应用清单中检查了VOIP Callsdef copy_freeze_model(model, nlayers = 1): new_model = Sequential() for l in model.layers[:nlayers]: l.trainable = False new_model.add(l) return new_model numClasses = 2 (X_train, Y_train, X_test, Y_test) = load_data(numClasses) #Part 1 rms = RMSprop() model = Sequential() #input shape: channels, rows, columns model.add(Convolution2D(32, 3, 3, border_mode='same', input_shape=(3, 32, 32))) model.add(Activation("relu")) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Dropout(0.5)) model.add(Flatten()) model.add(Dense(512)) model.add(Activation("relu")) model.add(Dropout(0.5)) #output layer model.add(Dense(numClasses)) model.add(Activation('softmax')) model.compile(loss='categorical_crossentropy', optimizer=rms,metrics=["accuracy"]) model.fit(X_train,Y_train, batch_size=32, nb_epoch=25, verbose=1, validation_split=0.2, callbacks=[EarlyStopping(monitor='val_loss', patience=2)]) print('Classifcation rate %02.3f' % model.evaluate(X_test, Y_test)[1]) ##pull the layers and try to get an output from the network that is image. newModel = copy_freeze_model(model, nlayers = 8) newModel.add(Dense(1024)) newModel.compile(loss='mean_squared_error', optimizer=rms,metrics=["accuracy"]) newModel.fit(X_train,X_train, batch_size=32, nb_epoch=25, verbose=1, validation_split=0.2, callbacks=[EarlyStopping(monitor='val_loss', patience=2)]) preds = newModel.predict(X_test) 但没有成功。你能帮帮我吗?感谢。

1 个答案:

答案 0 :(得分:4)

您必须为UWP包含 Windows Mobile Extensions 。只需添加一个新引用并进入Univerval Windows / Extensions。

如果需要,您可以在github上找到以下示例:https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/PhoneCall