tencent cloud

Game Multimedia Engine

製品アップデート情報
製品紹介
製品概要
優位性のある特徴
製品機能
ユースケース
セキュリティコンプライアンス認証
初心者ガイド
SDKダウンロードガイド
製品機能体験
基本機能Demo
シーン化体験
コンソールガイド
使用量の表示
サービスの有効化
クイックスタート
Quick Integration of SDK
Quick Integration of Sample Project
基本機能開発ガイド
Authentication Key
リアルタイム音声ロール設定
音質設定
拡張機能開発ガイド
サーバー側のレコーディング
レンジボイス
3Dサウンド
効果音と伴奏
ネットワークオーディオストリーム転送ルーティング
カスタムメッセージチャネル
社内ファイアーフォール制限への対応について
Language Parameter Reference List
GMEルーム管理機能の導入
クライアントAPI
SDK for Unity
SDK for Unreal Engine
Cocos2D SDK
SDK for Windows
SDK for iOS
SDK for Android
SDK for macOS
H5 SDK
Electron SDK
SDK for Flutter
SDK Version Upgrade Guide
エラーコード
Toolchain
Server APIs
History
Introduction
API Category
Usage APIs
Recording APIs
Making API Requests
Voice Chat APIs
Application APIs
Data Types
Error Codes
よくある質問
製品機能質問
問題解決ガイド
課金について
Sample Projectの使用上の問題
一般的な質問
認証について
リアルタイム音声ルーム参加失敗について
リアルタイム音声利用時に音声が聞こえない問題とオーディオ関連について
ネットワークについて
ボイス・ツー・テキスト変換について
プロジェクトエクスポートについて
Service Agreement
Service Level Agreement
お問い合わせ
用語集
GME ポリシー
データ処理とセキュリティ契約
プライバシーポリシー

Project Configuration

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-01-18 15:11:45
This document describes how to configure a Cocos2d project for the GME APIs for Cocos2d.

SDK Preparation

1. Download the applicable demo and SDK. For more information, see SDK Download Guide.
2. Decompress the obtained SDK resources.
3. The folder contains:
GMESDK: GME SDK framework file.
GMECocosDemo: GME SDK demo project.
Note:
The SDK supports compilation on macOS.

iOS Xcode Configuration

1. Add the framework to the Xcode project and set the header file import location (the framework file in the GMESDK folder must be added to the project).
2. Add dependent libraries as shown below:




Android Configuration

1. Add gmesdk.jar to the libs library.
2. Import the so file into Activity as shown below:
public class AppActivity extends Cocos2dxActivity {
static final String TAG = "AppActivity";
static OpensdkGameWrapper gameWrapper ;
static {
OpensdkGameWrapper.loadSdkLibrary();
}
}
3. Initialize in the oncreate function exactly in the following sequence:
protected void onCreate(Bundle savedInstanceState) {
super.setEnableVirtualButton(false);
super.onCreate(savedInstanceState);
// Initialize exactly in the following sequence
gameWrapper = new OpensdkGameWrapper(this);
runOnGLThread(new Runnable() {
@Override
public void run() {
gameWrapper.initOpensdk();
}
});
}
4. Configure your project for compilation options by referring to the Android.mk in the GME Demo for Cocos.
Path: GMECocos/GMECocosDemo/proj.android-studio/app/jni/Android.mk
Path to the preBuild.mk file: /Users/username/Downloads/GMECocos/GMESDK/android/bin/preBuild.mk

Exporting to Different Platforms

Project configuration is required before you can export executables from the Cocos2d engine for different platforms:

Android

Configuring required permissions

Add the following permissions in the AndroidManifest.xml file of the project:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
To use the voice messaging and speech-to-text feature, add the following under the application node in the manifest file:
<application android:usesCleartextTraffic="true" >

Adding permissions as needed

Add the following permissions in the AndroidManifest.xml file of the project as needed:
Read/Write permission
Bluetooth permission
The read/write permission is not required. Determine whether to add it according to the following rules:
If you use the default log path (/SDCARD/Android/Data/files), it means that you do not call SetLogPath, and do not need Write_External_Storage permission.
If you call the setLogPath API to set the log path to an external storage device, and the storage path of the voice message recording is an external storage device, you need to apply for the Write_External_Storage permission to the user and get the user's approval.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Add the Bluetooth permission according to the following rules:
If targetSDKVersion in the project is v30 or earlier:
<uses-permission android:name="android.permission.BLUETOOTH"/>
If targetSDKVersion in the project is v31 or later:
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

iOS

Add permissions:
Microphone Usage Description: Allows access to microphone.
Grant the Allow Arbitrary Loads permission as shown below:




Windows

You need to download the SDK for Windows as instructed in SDK Download Guide and import it into the project.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック